How to search for unique lines in a file

Find, replace, find in files, replace in files, regular expressions

How to search for unique lines in a file

Postby Quack » Sat Jan 08, 2005 4:25 pm

One more question i have tho... ;)

How can i let ultraedit search through the entire file, looking for duplicate lines? When it finds one it should delete the entire line, so the output will be a bunch of unique lines...

Example:

[input]
Hello
Helo
hello
1
2
3
3
4
[/input]

-->

[output]
Hello
Helo
hello
1
2
3
4
[/output]

Thanks in advance :)
User avatar
Quack
Newbie
 
Posts: 2
Joined: Sat Jan 08, 2005 12:00 am

Re: How to search for unique lines in a file

Postby Quack » Sat Jan 08, 2005 6:52 pm

never mind, found it :)
User avatar
Quack
Newbie
 
Posts: 2
Joined: Sat Jan 08, 2005 12:00 am

Re: How to search for unique lines in a file

Postby jack0fshad0ws » Mon Mar 14, 2005 4:30 pm

looking for the same thing. would you mind sharing it?:)
User avatar
jack0fshad0ws
Newbie
 
Posts: 1
Joined: Mon Mar 14, 2005 12:00 am

Re: How to search for unique lines in a file

Postby mjcarman » Tue Mar 15, 2005 9:08 am

If it's desirable/acceptable for your output to be sorted, go to File->Sort->Advances Sort/Options, check Remove Duplicates, and then sort your file. If it isn't acceptable for your output to be sorted, you'll need to write a script to do it outside of UE. (A macro might be possible too.)
User avatar
mjcarman
Power User
Power User
 
Posts: 125
Joined: Thu Feb 10, 2005 12:00 am


Return to Find/Replace/Regular Expressions