Template:CargoEquipment/doc

Data is stored at Template:CargoEquipment/data to ease operations on the table.

Data source:

Important note regarding updates: The Dismantle column does not distinguish between cards that have identical names (e.g. Decoy). This is problematic in instances where a page uses this table to call the or  templates, since we need to specify an alternate name to fetch the correct version of the card. Therefore, it is necessary to manually replace any occurrences of those cards every time the table is updated. At present (January 2020), this only affects Decoy and Drone Avatar:
 * Defense Drone: Decoy-2
 * Force Shield: Decoy-2
 * Ruster Trap: Drone Avatar (Leader)

Updating the database

 * 1) Export the 'equipment_raw' sheet from the source above to .tsv format and open it with your favorite spreadsheet software.
 * 2) Perform the replacements below by copy-pasting the fields into regexr.com, using the flags /gm for matching.
 * 3) Paste the final results into the /data page, replacing the current data.
 * 4) Manually fix the cards noted above to work around duplicate card names.

First, we need to perform a series of replacements on column 'Dismantle Cards' specifically to make it a Cargo-compatible list. Copy-paste only that column into regexr (excluding the 'Dismantle Cards' row). After each step, copy-paste the replacements into the Text and perform the next replacement.

1. Extract card names from array

Expression: \{\d+,"(?:([^\}]+)|)",\d+,"(?:([^\}]+)|)",\d+\} Replace with: $1;$2;

''2. Remove duplicate names

Expression: (?:;|^)(.+?)(?=;+(?:.+;+)?\1(?:;|$)) Replace with: (nothing)

3. Fix extra separations from empty fields and end/start of line

Expression: ^;+|((?=;))|;$ Replace with: (nothing)

Each row should now look like, without any duplicates or consecutive semicolons. Copy-paste the final results of those replacements back into the appropriate column in your spreadsheet, then paste the entire table into regexr (minus the header row) to perform a global replacement:

Expression: ^([^\t]*)\t([^\t]*)\t([^\t]*)\t(?:[^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t(?:[^\t]*)\t([^\t]*)\t([^\t]*)\t(?:\{"([^"]*)"\}|)\t(?:\{"([^"]*)",\d",\d,?\d{0,2}\}|)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t(?:[^\t]*)$ Replace with:

The data is now ready to paste back into the Cargo table. Remember to fix ambiguous names in the Duplicate column according to the update note at the top.