2

i have this data

aaa
aaa
bbb
ddd
bbb
ccc

how to keep only unique lines as this result

ddd
ccc

Thanks much for any help

user3528679
  • 43
  • 1
  • 5
  • This will just remove duplicates. User wants to remove all lines that occur more than once. – Olufon Feb 01 '17 at 17:30

2 Answers2

3

Try doing a find and replace all in regex mode with:

^(.*?\R)\1+

and replace with nothing.

Apologies, just observed this will not work is list is not sorted.

Olufon
  • 151
  • 1
  • 9
2

Two step

1st : Edit - Line Operations - Sort Lines Lexicographically Ascending
2nd : replace "(?-s)^(.+\R)\1+" with nothing

source :https://notepad-plus-plus.org/community/topic/12490/i-want-to-keep-only-unique-lines/2

Anyone can explain the answer ? .Thanks

user3528679
  • 43
  • 1
  • 5