List Reconcile
Language: English

Compare lists / Blog

Compare CSV files with different column order and headers

You can compare CSV files with different column order by selecting the same kind of identifier from each file. Column A in one export can correspond to column D in the other. Matching column positions or renaming headers is unnecessary when the tool lets you choose the comparison column independently on each side.

The harder question is whether those columns identify the same thing. An Excel user cross-checking exports from two systems described different formats and inconsistent names. The discussion included using a mapping table and stable identifiers. That reported task goes beyond rearranging columns: a tool cannot establish a relationship between two systems simply because their fields look similar.

Map the meaning before the position

Suppose a warehouse file uses stock_code and a catalog file uses sku. Ask whether both are the same code assigned by the same source. One might refer to a product family while the other refers to an individual size or color. Those are different comparison units even if a few sample strings overlap.

Write a short mapping before opening the files: “warehouse stock_code corresponds to catalog sku; one row represents one active item listing.” Note the export dates and any filters. This saves time when someone later asks why a retired item appears only in the warehouse file. The item may be absent because the catalog export excluded it.

Two files with deliberately different layouts

Use this fictional warehouse export as A:

stock_code,location,description
0007,A1,"Bracket, small"
0008,B2,Blue cable
0008,C3,Blue cable
0010,D4,Washer

The catalog export B puts its key in the second column:

label,sku,active
Small bracket,0007,yes
Cable blue,0008,yes
Spare screw,0009,yes

Open both files in Compare two lists. On A, choose stock_code. On B, choose sku. Both files have a header, so leave Header row checked. Keep exact matching for this example.

The expected values are 0007 with counts one and one, 0008 with two and one, 0010 with one and zero, and 0009 with zero and one. The different descriptions for 0007 and 0008 do not affect those results because the selected key is the identifier. The tool retains the descriptions in the source rows so you can inspect them separately.

You can load this fictional warehouse/catalog pair with the columns selected, or download the original A CSV and B CSV to follow the same steps yourself.

Check the preview before comparing

Expand Preview first 5 records on each side. Check that a phrase containing a comma, such as “Bracket, small,” occupies one field. If it appears split across columns, check the delimiter and quotes. A CSV field containing a delimiter or line break needs appropriate quoting; RFC 4180 describes the common comma-separated format and how quotes inside fields are doubled.

The files do not need to use the same separator. For example, set A to CSV (comma) and B to Semicolon if the second export uses semicolons. A pasted block copied from spreadsheet cells usually has tabs between columns, so choose TSV for that block. File extensions alone are not enough to confirm the format; the preview shows how the data was actually parsed.

If the first record contains data rather than labels, uncheck Header row. Leaving it checked discards that first data record from the comparison. Conversely, treating a real header as data can make stock_code and sku appear as unexplained differences. Inspect the first actual ID on both sides before interpreting the report.

Handle missing identifiers deliberately

An empty selected key is skipped and reported in the comparison status. It does not become an anonymous record that can be matched with every other blank key. Review those skipped counts, particularly when the source system permits draft records without an assigned ID.

A space-only field is different under exact matching: it contains characters. Turning on Ignore outer whitespace turns it into an empty key, which is then skipped. Choose this option only if surrounding whitespace is irrelevant to your identifier convention. The matching rules explain how cleanup changes comparison keys while leaving original records available.

If a row has fewer fields than the header, the parser reports a column-count error. Correct the export or its quoting before continuing. Quietly shifting the remaining values into another column would be worse than stopping, because it could compare a location or description as though it were an ID.

Do not mistake this for a full table diff

In the example, 0007 is present once in each file even though the descriptions differ. The counts are correct. A whole-row comparison would ask another question and might classify those two records as different. List Reconcile compares one selected field from each record and keeps the other fields as context; it does not generate a changed-cell report.

If matching needs a combination such as SKU plus warehouse, prepare a reliable key in the source system or use a join workflow that explicitly supports multiple columns. Simply joining values with a dash can create ambiguous keys when the values themselves contain dashes. This tool does not choose or validate a composite-key convention for you.

For renamed products or different ID systems, obtain an approved mapping table. Broad case or whitespace cleanup cannot turn one identifier system into another. Similar-looking descriptions are a reason to investigate a mapping, not a verified match.

Keep a record of the mapping with the result

Download an Excel or JSON report when you need the original fields alongside each comparison value. Save the untouched source exports too. Explain which file was A, which key you selected on each side, and whether either cleanup option was enabled. The report’s rules and source records help another person reproduce the same comparison.

If you need to hand someone the rows behind an “Only A” result, follow the guide to comparing lists while keeping original rows. If the key columns were selected correctly but values still look inexplicably different, check invisible characters and mismatching text before renaming or deleting records.

Open the list comparison tool → · All guides