Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep only unique line in notepad++

Tags:

notepad++

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

like image 949
user3528679 Avatar asked Dec 13 '25 21:12

user3528679


2 Answers

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.

like image 79
Penguin Avatar answered Dec 16 '25 22:12

Penguin


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

like image 22
user3528679 Avatar answered Dec 16 '25 21:12

user3528679



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!