Search HoldMyTwist

Compare two small CSV files by ID and check the changes

Compare two small CSV exports by ID with RowSlice. Use the practice files to check added, removed and changed rows, and spot blank or repeated IDs.

Two sets of paper stationery linked to show matching items, with a folder on one side and a lamp on the other.

In short

  • Use RowSlice's free Compare Two CSV Files tool to match records by a stable ID, even when their order changes. No account is needed.
  • Check every ID in both files before comparing. Stop for a blank or repeated ID, or if the preview does not show all your records.
  • Start with exact text. Check the added, removed and changed records, then reconcile the totals. A result with 0 rows left out can still contain a blank ID.

This walkthrough uses five-row fictional stationery exports. Use small, nonsensitive files with matching headers and one ID per record. Keep your originals. RowSlice says it processes files in your browser (opens in a new tab); that is the provider's privacy statement, not a security audit.

1. Open the practice files

  1. Download the practice ZIP and unzip it. It contains old.csv, new.csv, two practice files with blank or repeated IDs, and an answer key.
  2. Open RowSlice's comparison tool (opens in a new tab). Choose Browse Files, then select old.csv and new.csv.
  3. Check the Old file and New file labels. Use Swap Old and New if they are reversed. Added and removed are described from the new file's point of view.

The sample has the same three headers in each file: ID, Item and Amount. Amounts are fictional and have no currency. Each file contains five records; the header is not a record.

2. Read every ID before you compare

Watch out

A successful comparison does not validate your IDs. Check both complete previews before pressing Compare Files. If any record has no ID, an ID repeats within either file, or you cannot account for every record, stop and resolve it against the original source.

  1. In the old-file preview, read down ID: 0001, 0002, 0003, 0004, 0005.
  2. In the new-file preview, read down ID: 0005, 0002, 0001, 0006, 0004. The order is different; each ID still identifies its own record.
  3. Count five records in each preview. Check that each ID is nonblank, appears once within that file, and retains its leading zeros. For your own files, compare the preview count with the complete source export's record count.

An ID must refer to the same thing in both exports. A row number that changes when you sort the file will not work. This manual check is for files small enough to inspect completely; it does not detect every invisible character in an ID.

Read every ID in each file. These cropped RowSlice previews show all five fictional records per file, in different orders.

Cropped RowSlice previews show all five old IDs and all five new IDs in a different order, preserving leading zeros.

Cropped RowSlice previews show all five old IDs and all five new IDs in a different order, preserving leading zeros.

Read every ID in each file. These cropped RowSlice previews show all five fictional records per file, in different orders.

Open full-size image

To practise spotting problems, choose Choose Different Files. Pair duplicate-old.csv with new.csv and find 0002 twice in the six-row old preview. Pair blank-old.csv with new.csv and find the empty ID in the sixth old record. Stop at the preview for both examples. Do not invent IDs or delete legitimate records to make a warning disappear. Return to old.csv and new.csv for the remaining steps.

3. Compare the exact text

  1. Under Match rows on, tick ID only.
  2. Under A row counts as changed when, select any other column is different.
  3. Leave Ignore upper and lower case and Ignore spaces at the start and end of values off.
  4. Press Compare Files.
Leave both ignore options off to count changes in letter case and leading or trailing spaces. Cropped RowSlice screenshot.

RowSlice has Ignore upper and lower case and Ignore spaces at the start and end of values unchecked for exact comparison.

RowSlice has Ignore upper and lower case and Ignore spaces at the start and end of values unchecked for exact comparison.

Leave both ignore options off to count changes in letter case and leading or trailing spaces. Cropped RowSlice screenshot.

Open full-size image

The clean example returns 1 added, 1 removed, 2 changed and 2 unchanged. RowSlice preserves the leading zeros in the previews and in downloaded IDs such as 0002. It also keeps the comma inside "Notebook, blue" in the Item field.

For ID 0002, RowSlice shows Amount changing from 12.50 to 13.00. The full result also includes the trailing-space change in 0004. Cropped screenshot.

RowSlice Before and After detail for ID 0002: Amount changes from 12.50 to 13.00.

RowSlice Before and After detail for ID 0002: Amount changes from 12.50 to 13.00.

For ID 0002, RowSlice shows Amount changing from 12.50 to 13.00. The full result also includes the trailing-space change in 0004. Cropped screenshot.

Open full-size image

4. Check the records, then the counts

Read What changed and compare it with the original files and answer key:

  • 0006, Lamp, is added.
  • 0003, Folder, is removed.
  • 0002, "Notebook, blue", changes Amount from 12.50 to 13.00.
  • 0004 changes Item from "Pen" to "Pen " with one space after the word.
  • 0001 and 0005 are unchanged.

Fictional comparison: ID 0002 Amount changes from 12.50 to 13.00. Totals are one added, one removed, two changed and two unchanged; ID 0004 gains one trailing space.

Fictional comparison: ID 0002 Amount changes from 12.50 to 13.00. Totals are one added, one removed, two changed and two unchanged; ID 0004 gains one trailing space.
Open full-size image

The space after Pen is easy to miss on screen. Exact comparison counts it as a change. Only enable Ignore spaces at the start and end of values if those spaces should not matter. Repeating this sample with that option gives 1 changed and 3 unchanged, with the added and removed counts staying at one each. RowSlice says the option also affects matching keys (opens in a new tab), so review the IDs again before using it on your own files. If you try this option, turn it off and rerun old.csv with new.csv before continuing below.

For a valid one-ID-per-record comparison, check both totals:

  • Old file: 1 removed + 2 changed + 2 unchanged = 5 records
  • New file: 1 added + 2 changed + 2 unchanged = 5 records

These sums can reveal a count mismatch. They do not prove that the exports are complete or that the values are right. Read each changed value too.

Watch out

If Rows left out is above zero, stop and check the repeated IDs. RowSlice warns that it compares only the first occurrence of a repeated key. Zero is not an all-clear: our blank-ID example returned zero rows left out and counted the unidentified record as removed.

5. Download and inspect the results

Choose Download All as ZIP and unzip the result. This sample produces four files:

  • new-added.csv contains 0006
  • old-removed.csv contains 0003
  • new-changed.csv contains the new values for 0002 and 0004
  • old-changed-before.csv contains their old values

Keep each changed file beside its before version and match records by ID. The download contains no unchanged-row file; 0001 and 0005 remain in both original files.

Open the CSVs in a text editor if you need to inspect the leading zeros, quotes or trailing space exactly. If you import them into a spreadsheet, preserve ID as text and check it after import. A comparison report does not decide which version is correct or merge the files for you.

If the result looks wrong

  • Nearly everything is added and removed: check that the chosen ID is stable and that the old and new files are the intended pair.
  • A column is missing or renamed: stop this walkthrough and align the export headers at the source. Do not assume that unpaired columns were compared.
  • A warning appears, a count disagrees, or part of a file is outside the preview: keep the originals and resolve the input before using the report. This small-file manual check is not a large-file validation method.

Sources: RowSlice comparison instructions (opens in a new tab), privacy statement (opens in a new tab), terms of use (opens in a new tab).

Share this guide