CSV / keyed diff guide

Compare CSV snapshots by ID and hand off only changes

Comparing by row number makes a reorder look like a full rewrite. Use a stable ID to classify changed, added, removed and unchanged rows. Stop when keys are duplicate or missing.

Use a key, not a row number

Class判定Handoff
changedSame ID, different valueOld and new values
addedID exists only in newNew row
removedID exists only in oldOld row
unchangedID and values matchOmit from change list

Duplicate or blank IDs must stop the comparison instead of guessing a match.

Reproduce it with fixtures

old.csv and new.csv are reordered: A002 changes, A003 is removed and A004 is added. expected.csv is the change-only result; duplicate.csv is a negative case.

id,status,old_price,new_price
A002,changed,200,220
A003,removed,300,
A004,added,,400

A001 is absent from the expected changes because it is unchanged.

Verify and hand off with Web-Tool

  1. Keep both snapshots unchanged.
  2. Use Table to Excel to inspect the key column and values.
  3. Confirm keys are unique and non-empty before classifying changes.
  4. Give the recipient expected.csv, checklist.md and the change basis.

This guide and Table to Excel work in the browser. CSV files and input are not sent to an external server.

Cases that cannot be finalized

If keys are duplicated, blank or semantically changed, do not match by name or row order. Confirm the source owner first.