Remove duplicate lines in a file...

Want to suggest an idea for a new plug-in? Know for sure what is needed for plug-in X to become the best? Write here.
Locked
KtW
Posts: 22
Joined: Mon Apr 11, 2005 8:27 pm

Remove duplicate lines in a file...

Post by KtW » Fri Jan 20, 2006 11:57 pm

Hi all! :)

Do you know a plugin that can remove duplicate lines when editing a file?

For example i've this file

----------------
123
124
123
125
126
123
135
----------------


If i issue the command "Remove duplicate line" the resulting files will be:


----------------
123
124
125
126
135
----------------

Think about If we ve a file with 100000 lines it will be a great help such plugin!

Any clue? ...thanks for any suggestion!

PS: I can think about some other functions for such plugin like for example:

- "Keep duplicate line"
- "Keep diffrent line"
- "Keep unique line"
- "Custom template"

jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib » Sun Jan 22, 2006 6:42 pm

Hi

I don't know if there is a plugin that does what you want but I would use two
commandline commands "sort" and "uniq" that would sort and remove duplicate lines.

You could make a macro or something in Far manager.

"Sort" is included in windows just use "sort /?" to get help.
"uniq" is a unix command port to win32 from this tool pack http://unxutils.sourceforge.net/

jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib » Sun Jan 22, 2006 10:16 pm

For sorting in the editor there is "String sorter" plugin.
http://plugring.farmanager.com/cgi-bin/ ... hText=uniq

KtW
Posts: 22
Joined: Mon Apr 11, 2005 8:27 pm

Post by KtW » Wed Jan 25, 2006 8:36 pm

He He... Thanks For The Tips jonib I've Already Have The Sort Plugin Installed...

...Now My File Appear Like...

----------------
123
123
123
124
125
126
135
----------------

...I'll Try To Look At The Uniq Tool... But I'll Be A More Elegant Solution To Have A Far Native String Manipulation Plugin ;)

...I'm Thinking About At Some RegExp Functions But I'm Not So Good At Programming Them ;)

Locked