Should I sort my list first so duplicates sit together before removing them, or is that unnecessary?
Unnecessary. The duplicate-line remover finds a repeat anywhere in the list, not just next to its twin, and keeps the first occurrence of each line in its original position. The list comes out without repeats and in your own order. Sort first only if you want the final list sorted, and you can just as well do that afterwards.
Where the 'sort first' habit comes from
In spreadsheets and some older tools the familiar method was to sort a column so repeats sit next to each other, then delete every row equal to the one above. It works, but it forces an alphabetical order you did not ask for and throws away the original order, which may mean something: the order orders arrived in, the priority of products on a page, or a sequence of steps.
Both approaches on one example
The original list, six lines in the order orders arrived: coffee, tea, coffee, dates, coffee, tea.
Removing duplicates directly: coffee, tea, dates. That is first-occurrence order, with 3 lines removed.
Sorting first with the line sorter gives: coffee, coffee, coffee, dates, tea, tea, and removing duplicates then gives: coffee, dates, tea.
Both results hold the same three products, but the first records that coffee came first and tea second, while the second keeps no order except the alphabet. If the original order matters to you, the direct route is the only one that keeps it.
When sorting does help
- When you want the final list alphabetical for publishing or easy reading. Sort after removing or before; the result is the same.
- When you want to spot near-repeats by eye, such as 'coffee' and 'cofee'; sorting puts them close together.
- When you are comparing two lists with each other, not removing repeats within one list.
How to do it
- Paste the list into the Duplicate-line remover as it is, unsorted.
- Choose the matching options that suit your data.
- Copy the result. If you want it alphabetical, paste it into the Line sorter afterwards.
A bonus of the direct route: the repeats table
When you remove repeats directly, the tool shows 'Lines that repeated' with each line's occurrences; in our example coffee 3 times and tea twice. That count would be the same if you sorted first, but sorting and deleting by hand in a spreadsheet only gets you this count with extra steps.
And which copy stays? Always the first occurrence, as written. In an unsorted list that means the earliest line, which is usually what you want when copies look alike but differ in something matching ignores, such as a trailing space with space-ignoring turned on.
Common questions
Is the tool slower on an unsorted list?
No, it was tested on 100,000 mixed lines and computed the result in under a second.
Does the tool sort the list?
No, it only removes repeats. Use the line sorter for sorting.
Is my list sent to a server?
No, everything stays in your browser.
