1

Im using notepad++ and i have a have large text file with lots of lines that all contain a string with no spaces, I need a way to remove all lines that occur more than once.

For example:

    name1
    name1
    name2
    name3
    name4
    name4
    name5

Would be changed to

    name2
    name3
    name5
Rising24
  • 13
  • 2

1 Answers1

1

Search for ^(.*?\R)\1+ and replace with nothing.

From start of line ^, find all characters .*? until the linebreak \R. Then repeat \1 the search from () one or more times +.

Use regular expression search mode.

Lines must be sorted before doing this.

Last line must end with linebreak, or it will not be matched.

user694733
  • 15,208
  • 2
  • 42
  • 68