example:epshetsky@test.com,
rek4@test.com,
rajesh1239@test.com,
mohanraj@test.com,
sam@test.com,
nithin@test.com,
midhunvintech@test.com,
karthickgm27@test.com,
rajesh1239@test.com,
mohanraj@test.com,
nithin@test.com,
I need results back like
epshetsky@test.com,
rek4@test.com,
sam@test.com,
nithin@test.com,
midhunvintech@test.com,
karthickgm27@test.com,
- sort line with Edit -> Line Operations -> Sort Lines Lexicographically ascending
- do a Find / Replace:
- Find What:
^(.*\r?\n)\1+
- Replace with: (Nothing, leave empty)
- Check Regular Expression in the lower left
- Click Replace All
- Find What:
How it works: The sorting puts the duplicates behind each other. The find matches a line ^(.*\r?\n)
and captures the line in \1
then it continues and tries to find \1
one or more times (+
) behind the first match. Such a block of duplicates (if it exists) is replaced with nothing.
The \r?\n
should deal nicely with Windows and Unix lineendings.
https://stackoverflow.com/questions/35329122/find-duplicates-and-delete-all-in-notepad