A supplier catalogue arrives as three separate exports. You paste them one under another into a single document, planning to load the combined list into your shop, and the result is a mess: the same product appears two or three times, spelled slightly differently each time, with blank lines scattered where the exports were joined. Deleting the repeats by hand in a list this long is not realistic, and eyeballing it will miss the near-identical lines every time.

This guide works through exactly that job with the free Remove Duplicate Lines tool on Ovatly. One honesty note before the numbers: the 2,000 line list below is an illustrative example written for this guide, not a real customer file. The counts are worked out so the arithmetic is consistent from start to finish, which is the same check you should run on your own list afterwards.

Contents

  • Quick answer
  • What counts as a duplicate
  • The two rules that decide the result
  • How to clean the list, step by step
  • Worked example: 2,000 lines down to 1,319
  • Limitations and honest notes
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

Paste the list into Remove Duplicate Lines, one item per line. Leave trimming on so lines that differ only in stray spaces count as duplicates, run it once, then decide whether lines that differ only in capitalization should also merge; if they should, turn on case-insensitive matching and run the result again. The first occurrence of each line wins, blank lines collapse to a single blank line, and the tool reports how many duplicates were removed. The output is not sorted; it keeps the order of first appearance.

What counts as a duplicate

The tool compares whole lines, one against another. Two lines are duplicates when they match under the rules you have set, and a match means the later line is dropped and the first one stays, with its exact spelling and capitalization kept. That first-occurrence rule matters more than it sounds: if the cleanest spelling of a product name appears third in your paste, the tool will keep the first, messier spelling instead. Order your sources so the version you trust most goes in first.

Blank lines count as lines too. A run of blank lines, the kind you get where two pasted files join, collapses to a single blank line. In a list built from several exports, that collapse alone can account for a noticeable share of the removed count.

The two rules that decide the result

The first rule is capitalization: whether USB Cable 1m and usb cable 1m count as the same line. With case-sensitive matching, they are two different lines and both survive. With case-insensitive matching, the second one is a duplicate and is dropped.

The second rule is trimming: whether surrounding spaces are ignored. With trimming on, which is the default, a line with two trailing spaces counts as the same line as the clean version. Pasted exports are full of invisible trailing spaces, so leaving trimming on is right for almost every cleanup job.

Neither rule can see meaning. Two lines that name the same product in different words, such as USB Cable 1m and USB-C lead, 1 metre, are different lines under every setting and both survive. Deduplication removes repeated lines; it does not merge near-duplicates that a human would recognise as the same item.

How to clean the list, step by step

  1. Paste your list into Remove Duplicate Lines, one item per line. Windows, Mac and Unix line endings are all recognized, so a list copied from any system works as pasted.
  2. Decide the rules: whether lines that differ only in capitalization count as the same line, and whether surrounding spaces are ignored. Trimming is on by default.
  3. Read how many duplicates were removed above the result, and check the result line count against your own arithmetic.
  4. Copy or download the unique lines.

Worked example: 2,000 lines down to 1,319

Here is the illustrative list. It was built by pasting three exports together, and it contains exactly 2,000 lines: 1,940 product lines and 60 blank lines scattered at the joins. Among the product lines, some repeat exactly, some repeat with different capitalization, and some repeat with trailing spaces picked up during copying.

Before the big list, the small version of the same behaviour, taken from the tool's own documentation. Paste these five lines:

apple
banana
apple
Cherry
banana

With the default settings the result is apple, banana, Cherry, and the tool reports 2 duplicates removed out of 5 lines. The first apple and the first banana win; the repeats go.

Now the 2,000 line list, cleaned in two passes.

Pass 1, default rules (trimming on, case-sensitive). This pass removes three groups: 402 product lines that repeat an earlier line exactly, 83 lines that differ only by leading or trailing spaces, and 59 of the 60 blank lines, which collapse to one. That is 544 lines removed, leaving 2,000 minus 544, which is 1,456 lines.

Pass 2, case-insensitive matching on. Run the pass 1 result again with the capitalization rule relaxed. This removes 137 more lines: product lines that repeated an earlier line with different capitalization, such as a lowercase version of a name that already appeared in capitals. The first spelling wins in each case. That leaves 1,456 minus 137, which is 1,319 lines.

The final check: 544 plus 137 is 681 duplicates removed in total, and 2,000 minus 681 is 1,319. The result is 1,318 unique product lines plus the single surviving blank line. If your own cleanup numbers do not reconcile this way, a setting is not doing what you think it is, and the pass-by-pass counts tell you which one.

Limitations and honest notes

The tool works line by line. It cannot remove duplicates inside a paragraph, because sentences inside one line are never compared with each other. It cannot merge lines that describe the same item in different words, and it cannot fix a wrong spelling; it only keeps the first version it saw. It also does not sort, by design: the output preserves the order of first appearance, which is often what you want for a catalogue that follows the supplier's own grouping. If you need alphabetical order, that is a second step with a sorting tool. Finally, the first-occurrence rule cuts both ways: whatever spelling appears first is the one that survives, so a sloppy first export sets the spelling for the whole cleaned list.

Common mistakes

  • Pasting the worst copy first. The first occurrence wins with its exact spelling, so put the cleanest source at the top of the paste.
  • Expecting one pass to catch everything. Exact repeats, space variants and case variants are caught by different settings; run a second pass with case-insensitive matching if the first count looks low.
  • Assuming near-duplicates merge. Same product, different wording means different lines. Those need a manual pass or a find and replace cleanup first.
  • Forgetting the blank lines. Sixty blank lines collapse to one, which is correct behaviour, but it inflates the removed count and can make a healthy result look suspicious.
  • Skipping the arithmetic. The removed count plus the result count should equal the pasted count. If it does not, stop and find out why before using the list.

FAQs

Does it sort the result? No. The output keeps the original order of first appearance. If you also want sorting, run the result through the Sort Lines Tool afterwards.

Which copy of a repeated line is kept? The first occurrence wins: its exact spelling and capitalization are kept, and later repeats are dropped. With case-insensitive matching on, the first version you pasted is the version that survives.

Two lines look identical but both survived. Why? They differ in a way the current settings treat as real: a different capitalization with case-sensitive matching on, or a leading or trailing space with trimming off. Adjust the two rules and run the list again.

Can it remove duplicates inside a paragraph? No, it works line by line. Sentences inside one line are not compared with each other, so repeated sentences inside a paragraph stay untouched.

Is there a size limit, and is my list uploaded? Lists of hundreds of thousands of lines are handled comfortably because the check runs locally on your device. Your list is not uploaded.

Conclusion

Cleaning a long list is two decisions, not one: what counts as the same line, and which spelling gets to survive. Set the capitalization and trimming rules deliberately, run the passes, and reconcile the counts before you trust the result. For the companion job of changing a word everywhere it appears rather than removing whole lines, see How to Replace a Word Everywhere It Appears. More guides like this one live in the Text and Writing Tools guides.