Diff two CSV datasets
Compare two CSVs. With a key column: report rows added, removed, and changed (by that key). Without one: a whole-row multiset diff, added/removed counts of exactly-equal rows, order-independent, duplicates counted. Read-only. Quote-aware: a record with a quoted field containing a literal newline is compared as one record. Runs entirely on your device.
Runs on your device. The file is never uploaded.
Diff two CSV datasets compares exactly two files and prints added, removed and, with keyColumn set, changed rows field by field. Leave keyColumn blank and it becomes a whole-row multiset diff: order is ignored and duplicate rows are counted. Comparison runs on parsed cells, so two files differing only in quoting or line endings come back identical.
Questions
How do I compare rows by an ID instead of whole rows?
Put the header name in keyColumn. Rows are then matched by that column value across the two files, and you get added keys, removed keys and, for keys present in both, a per column list of what changed in the form old to new. If the column is missing from either file, the tool refuses and prints the header it found there so you can check the name.
What happens if I leave keyColumn blank?
You get a whole row multiset diff. Every row is compared as a complete record, order is ignored, and duplicates are counted, so a row present twice in one file and once in the other shows as one addition. The output marks additions with a plus and removals with a minus, with a count prefix when more than one copy differs.
Does it change either file?
No. Both files are read and compared and the result is a text report. Nothing is written and no output file is produced, so this is safe to run on data you have not backed up. The comparison also happens on parsed cells rather than raw bytes, so nothing depends on how either file was quoted or laid out.
How many files does it take?
Exactly two, and it says so if you give it a different number: "dataset-diff needs exactly 2 files". The first is the before and the second is the after, so additions are rows present in the second file only. An empty file on either side is refused by name.
What happens with duplicate keys?
The last row wins. When rows are indexed by keyColumn, a repeated key overwrites the earlier row in the lookup, so only the final occurrence is compared. If your key is not unique, use the whole row mode instead, which counts duplicates properly.
Will it say identical for files that differ in formatting?
It can, and that is deliberate. Comparison happens on parsed cells, not on raw bytes, so different quoting, different line endings or a different row order in whole row mode all still compare as identical. If the cells match, you get "identical" and no diff lines.