← Practical guides

Compare reordered CSV catalogs by product code and read the change report

A line comparison answers whether lines differ. A catalog review usually asks whether the same product changed, even when somebody sorted the list or rearranged columns. This exercise uses an old CP949 catalog and a new UTF-8 catalog, matched by the product-code column 상품코드. The source lists are fictional and were created for this walkthrough.

Example files

Before catalog / CP949 / 74 bytes

Header order: 상품코드, 상품명, 수량. Three data rows with codes 00042, 00043 and 00044.

Download / 74 B

After catalog / UTF-8 / 90 bytes

Header order: 수량, 상품코드, 상품명. Three data rows, deliberately ordered 00043, 00042 and 00045.

Download / 90 B

Reference change report / 217 bytes

UTF-8 BOM / comma / CRLF. Five report entries under the seven English report headers.

Download / 217 B

Follow the steps

  1. Read each source with its own format

    Select catalog-before-cp949.csv as Before and catalog-after-utf8.csv as After in CSV compare. Choose CP949 for Before, UTF-8 for After and comma for both delimiters. Read both files. Confirm that the key choices include 상품코드 and each source has 3 data rows. To inspect product names before comparing, open each original separately in the CSV checker with its matching encoding.

    Open tool →
  2. Choose an identifier that remains stable

    Select 상품코드 as the unique key. Leave surrounding-whitespace ignoring and formula prefixing off, then compare. A name or quantity is a poor key here because those values can legitimately change. The key must be nonblank and unique inside each individual source file.

  3. Separate row counts from cell counts

    Expect 1 added row, 1 removed row, 1 changed row, 1 unchanged row and 1 changed cell. Code 00042 retains its name but its 수량 changes from 10 to 12. Code 00043 stays unchanged despite moving from the third physical line to the second.

  4. Trace a report entry back to both sources

    Download the report and compare it with catalog-changes.csv. The changed entry for key 00042 names column 수량 and carries before 10, after 12, before_line 2 and after_line 3. Check those lines in the two source files. The removal of 00044 has no after_line; the addition of 00045 has no before_line.

  5. Decide how to use the report without altering the originals

    Review all five report entries, including the product name and quantity entries for each added/removed row. Keep both originals with the report. The report describes differences; it is not a merged catalog or an instruction to delete records automatically. When sharing it with spreadsheet users, review whether formula prefixing is needed and disclose any added apostrophes.

Measured results

The example has four distinct product codes across the two catalogs, while each individual catalog has three data rows. The five report entries represent one changed cell plus two fields for the removed product and two for the added product. They do not mean that five products changed.

Added rowsRemoved rowsChanged rowsUnchanged rowsChanged cells
11111
ChangeKey valueColumnOld valueNew valueOld lineNew line
Changed rows00042수량101223
Removed rows00044상품명지우개4—
Removed rows00044수량34—
Added rows00045상품명연필—4
Added rows00045수량7—4

Understand the result

Row order and column order are independent of identity

The tool pairs rows by the exact key string and pairs columns by their names. It therefore sees code 00043 as unchanged when both its position and the header order move. Both files still need the same set of column names, including case and spaces. Renaming a header is a schema difference, not a value change this comparison can align automatically.

Exact keys preserve distinctions that may matter

00042 and 42 are different identifiers, as are keys with different surrounding spaces or letter case. A changed key appears as a removed old row and an added new row; the tool cannot infer that they refer to the same product. Ignoring surrounding whitespace affects only non-key value comparisons. It never normalizes keys or edits the original cells.

A blank report field does not always mean a blank source cell

For changed entries, both source rows exist; an empty before or after field can therefore represent a real empty cell. For added entries, the before row is absent, and for removed entries, the after row is absent. Read status together with before_line/after_line to distinguish missing sides from empty values. Never fill all blank fields with zero.

The report counts fields, while the summary also counts rows

A row with three changed non-key cells contributes one changed row and three changed cells. An added/removed row contributes an entry for each non-key column, even if a field is empty. With a file containing only the key column, an added/removed key gets one report entry instead. The changed-cell counter concerns matched rows, so it excludes all fields belonging to added/removed rows.

Line numbers refer to physical source lines

The header is physical line 1 in these samples, so their data starts at line 2. A quoted field can contain a line break; later records can then begin beyond the next simple row number. The report identifies each record’s starting physical line, not its position after sorting or its displayed spreadsheet row under another import.

Formula prefixes change the report representation

When enabled, formula prefixing adds an apostrophe before report values that look like spreadsheet formulas. That can affect keys and cell values. It does not change the comparison’s row identity or either source file. The supplied reference has the option off, so use that setting when reproducing its exact bytes.

When the result is different

There are two rows for the same key. Why not compare them in order?
Their correspondence would be ambiguous after sorting. Select a genuinely unique identifier or resolve duplicates in the source system and export again. The tool rejects duplicate, empty and whitespace-only keys instead of choosing or merging rows arbitrarily.
The files have the same-looking headers, but they are rejected.
Check exact case, spaces, blank/duplicate headers and each record’s field count. Both files must have the same header set and consistent row widths. Also confirm the chosen delimiters and input encodings. The CSV checker can inspect one source separately before you compare.
Why did one edited identifier become two differences?
Changing the key breaks the match. The old key is removed and the new key is added. Confirm identity in the source system before treating them as a rename; the comparison deliberately does not guess from similar names or quantities.
Why did enabling whitespace ignoring reduce changed cells?
Leading/trailing whitespace is excluded only when comparing non-key values. Cells equivalent after trimming are omitted from the report, while their original text remains in the source. Interior spaces and key differences still matter. Record the option you used when handing off a report.
Can this report update my catalog automatically?
No. It is a separate CSV describing the differences, not a patched source file. Review status, key, column and the two line references, then make any approved update in the system that owns the catalog.

Test conditions and sources

The local Chromium check selects the two actual mixed-encoding files, compares with key 상품코드 and both optional transformations off, and downloads the report. Verification compares its full bytes with catalog-changes.csv and checks the summary counts and source-line references. This is a browser comparison of invented examples, not a native Excel test, a business-data audit or evidence that an added/removed product should be changed in a live system.

Chromium 156.0.8078.4 / Windows / local browser checks and byte-level measurements /

Download measurements and file checksums (JSON)