Compare CSV tables by a key column
When two CSV exports come from different database queries or spreadsheet sorts, every row shifts position. A standard line diff marks the whole file as changed instead of showing which rows actually updated.
Why row-order text diff fails on CSV
Suppose Content A and Content B contain the same product catalog, except rows appear in a different order and two prices changed:
sku,item_name,unit_price,status
0042,USB-C Presenter Remote,29.00,active
0204,Wireless Lapel Microphone,64.00,active
In a plain text diff, moving 0042 from row 2 to row 5 creates false deletions and additions across unrelated lines.
Match rows by a shared key column
- Open the working CSV example below (or paste two CSV/TSV tables and select CSV).
- Choose Key: sku from the toolbar key-column dropdown.
- Folio aligns rows by their shared
skuvalue regardless of row order, aligns reordered columns by header name, preserves original line numbers, and highlights only changed cells in Inspect.
Open the CSV key-column example
Data fidelity and limits
- Strings stay exact: Leading zeros such as
0042and formatted prices such as29.00are never coerced into JavaScript numbers. - Duplicate keys: If the chosen key column contains duplicate values, Folio warns and pairs duplicates in order of appearance.
- Malformed CSV fallback: Files with unclosed quotes or uneven field counts pause key-column matching and report exact line diagnostics while keeping text comparison available.
- Private spreadsheets: Parsing runs locally in your browser; financial exports and customer lists never leave your device.
folio