FileDial › Guides › Documents, spreadsheets and slides

How to remove duplicate rows from a CSV file on a Mac

By Himanshu Ranjan · Updated 8 November 2026

Select the CSV or spreadsheet in Finder, open FileDial and choose Data › Remove duplicate rows. It saves a new copy that keeps the first of each identical row. Rows must match in every column to count as duplicates. It runs offline on your Mac, and the original stays untouched.

What counts as a duplicate

The tool's note says it keeps the first of each identical row. Identical means the whole row, every column. Two rows that share an email address but differ in a phone number are not identical, so both stay.

That literal reading is a feature: it will not delete a row you did not mean to remove. It also means near-duplicates, such as a trailing space or a different capital letter, survive.

Steps

Work on the merged file, not the sources.

  1. Select the file in Finder; it is listed for spreadsheets.
  2. Open the dial with the right Option key and choose Data, then Remove duplicate rows.
  3. Open the new copy and compare the row count with the original.
  4. Keep the original until you are sure the count is what you expect.

Cleaning before you dedupe

Because only exact matches count, tidy first. Differences in spacing, case or line endings hide duplicates. Developer › Convert line endings to LF and Developer › Convert to UTF-8 normalise the file, and trimming spaces inside the spreadsheet handles the rest.

CSV also has no types, so 1 and 1.0 are different text. If your duplicates differ only in formatting, fix the formatting first.

Where it fits in a workflow

A typical sequence: Data › Merge CSVs to stack monthly exports, Data › Remove duplicate rows to clean the stack, then Convert › Convert to Excel (XLSX) or Data › Convert CSV to JSON for the destination. Each step makes a new file, so you can go back.

Built-in alternative

Excel has a Remove Duplicates command on its Data tab that lets you choose which columns define a duplicate, which is the main thing the FileDial tool does not do. For whole-row dedupes on a CSV, Terminal's sort -u works, but it reorders the rows and does not respect the header, so we would not recommend it for real data.

A worked example

Take a mailing list exported twice from two tools. Merge them with Data › Merge CSVs, then run Data › Remove duplicate rows. Any person who appears with exactly the same values in every column is kept once. A person whose phone number differs between exports appears twice, because the rows are not identical.

That last case is the usual surprise. If you need to dedupe by email only, you need a column-based tool, such as the Remove Duplicates command in Excel, where you pick the columns.

Common mistakes and when FileDial fits

Compare the row counts before and after. Sort the output by the column that should be unique and scan for neighbours that look alike. If you still see look-alikes, the difference is probably invisible: a trailing space, a different case, or a different line ending. Fix those in the source, run the tool again, and compare once more.

Spreadsheets work too: the tool is listed for spreadsheet files, so you can run it on an XLSX. For stricter cleaning, convert to CSV with Convert › Convert to CSV, clean, and convert back with Convert › Convert to Excel (XLSX).

It is quick and safe for whole-row dedupes, especially after merging exports. It is not the tool for fuzzy matching, such as treating Jon Smith and Jonathan Smith as the same person. That needs a spreadsheet or a dedicated cleaning tool and some human judgement.

Because the tool keeps the first of each identical row, the order of your data decides which copy survives. If you prefer the newest, sort the file by date, newest first, in a spreadsheet and export again before running it.

Expecting fuzzy matching is the main error: the tool removes identical rows only. A second is running it on data where repeated rows are meaningful, such as two identical purchases on the same day that were really two sales. Check that your data has a unique key or time stamp before deduping. A third is forgetting to compare counts before and after. A fourth is deduping before merging, and merging afterwards, which reintroduces duplicates.

Order your steps: merge, clean encoding, remove duplicates, then convert to the final format.

A last practical point: dedupe on a copy of the data and keep the full version somewhere safe. If a downstream report later needs the repeated rows, for example to count how often something happened, you will want them back. The tool's new copy leaves your source in place, so keeping both costs nothing but disk space.

Questions

Which row is kept when duplicates are found?

The first of each identical row is kept, as the tool's note says, and later identical rows are removed. The order of the remaining rows follows the original. A new copy is saved, so your source file with every row still intact stays untouched beside it.

Can I choose which columns count as a duplicate?

The tool compares whole rows, so two rows must match in every column to count as duplicates. If you need to dedupe by one column such as email, use Excel's Remove Duplicates command, where you choose the columns, or clean the data so the other columns match.

Why are some visible duplicates still in my file?

Only identical rows are removed. Extra spaces, different capital letters, different line endings or small formatting differences make rows differ. Tidy the source first, for example with Developer › Convert to UTF-8 and Developer › Convert line endings to LF, trim spaces in a spreadsheet, and run the tool again.

Sources

  1. Wikipedia: Comma-separated values
  2. Wikipedia: Microsoft Excel

Related

Try FileDial free for 1 daySee the dialNo card, no account. Then $20 once, for 2 Macs. Runs offline on macOS 14+ (Apple silicon).