Most dedupe tools keep one copy of each repeated line and delete the rest. But sometimes that's the wrong result. Sometimes a value that appears twice is bad data, and you want it gone completely — only the lines that appear exactly once should survive.
Real examples: sign-ups who registered twice and must be excluded entirely, customers who appear in two monthly exports when you only want the new ones, or SKUs that show up twice in a supplier file with different prices (keep neither until a human checks).
Here are the ways to do it, from spreadsheets to one paste.
In Excel / Google Sheets (modern versions)
=UNIQUE(A2:A1000, FALSE, TRUE)
The third argument is the trick: TRUE means "only rows that occur exactly once". Every copy of a repeated value is excluded.
With a helper column (any version)
Put this next to your data and fill down:
=COUNTIF($A:$A, A2)
Filter for 1 and you have the appear-once list. Filter for anything above 1 and you see every copy of every repeat, grouped for deletion.
On the command line
sort list.txt | uniq -u
uniq -u prints only lines that are not repeated. Its partner uniq -d prints one copy of each repeated line — together they split any list into "appeared once" and "appeared more than once".
In Python
from collections import Counter
counts = Counter(lines)
only_once = [line for line in lines if counts[line] == 1]
This keeps the original order, which the sort-based methods don't.
One paste, in the browser
If the list is a single column and you don't want formulas, I built a free tool for exactly this: Remove Duplicate Lines — paste the list, tick "Remove ALL copies of repeated lines", and only the lines that appear once stay. It runs entirely in your browser; nothing is uploaded. (Full disclosure: the tool is mine — it's free, and the default mode on the same page is the normal keep-one dedupe.)
If you clean lists like this every week, the same toolset has a Pro version ($19 one-time) with a bulk mode — up to 50 lists in a single run, saved presets, CSV export. The free page above covers the single-list job completely.
One warning before you dedupe anything
Trailing spaces and casing make identical-looking lines count as different values. "apple " and "apple" are different strings. Trim first (and ignore case if your data needs it), or your "duplicates" will quietly survive.
Top comments (0)