How to delete duplicate lines ?
-
i am wondering how to delete duplicate lines in notepad++
for example
1
1
2
3
3
4
4
4result
2 -
find:
^(\d+)(\R\1)+\R
replace: nothing
search mode: regular expression -
@alan-kilborn
its not worked, if i have many lines, 5 millions data
i would like to delete duplicate dataa
a
b
c
c
c
d
d
d
d
e
f
f
g
h
h
hresult expected
b
e
g -
@bolapedia-gg said in How to delete duplicate lines ?:
its not worked
Did you try it on the data you originally supplied?
-
@bolapedia-gg
This regex does the transformation:(^.*?\R)\1+
But first go to the end of the file and make sure there is one blank line at the end. (If this isn’t satisfactory I’m pretty sure there’s a way to fix that).
-
@neil-schipper said in How to delete duplicate lines ?:
I’m pretty sure there’s a way to fix that).
(?-s)^(.+)(?:\R\1)+(\R|\z)
Use
*
instead of+
if it is desired to remove duplicate contiguous empty lines. -
This post is deleted!