Help - Search - Members - Calendar
Full Version: Remove Duplicates Macro
BleepingComputer.com > Software > Programming
   
Illegal Alien
I think this is the write forum for this question. . .

I'm looking for a macro or plugin that will remove duplicate lines from a file. It has to find only duplicate lines, not words or strings. Anyone know where I can find such a macro, or how I can make one? I have MS Word '07 and Notepad++
groovicus
I found a couple hundred on Google.. any reason why one of those will not work?
Illegal Alien
All the ones I've looked at are:
1. For Excel, not Notepad++ or Word
2. For MS Word TABLES not plain text files
3. Don't understand how you use them
4. They don't work, or links are outdated
Illegal Alien
What is 'awk' and how do you use it?
groovicus
You start out with Linux..... perhaps you would be more interested in Gawk?

Would I be correct is assuming that all you want is a GUI that you input a file name, and it deletes the duplicates?

I threw together a simple java application that will do the job. If you have java installed on your system (and most people do), all you have to do is double-click on the file to run it. It will open a file browser. Select the file that you want to remove duplicates from, and select ok. Of course, make a backup copy of the file first, just in case something goes wrong.

Disclaimer and source code can be found here.

Illegal Alien
Cool, thanks! CLI doesn't bother me. I know how to make batch files and use AutoHotkey to make scripts (simple, like AutoIt3)

Script worked like a charm on a 25,000 line document. I used it on my "drivers\etc\host" file, basically to update it with a newer list since replacing it would delete some of my own entries. Also used it to weed out all the dupes in a 50,000 line word list. So now you know it works =]
groovicus
Cool! It's always fun to write a program that someone actually finds useful. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.