I have a large text file with thousands of entries on it (each on a new line) which were copied and pasted from different sources, but the problem is that hundreds of the entries are likely to be there more than once. So I would like a batch program to look at this file (let's call it list.txt) and remove anything that appears twice (or more times) leaving only one of every entry. For example:
a
b
c
a
a
b
would become:
a
b
c
(Any duplicates have been removed, leaving only one of each unique entry in the list.)
Could answerers please leave the code in their answer, I will create a batch file from this. For a better chance of best answer, explanations of what different commands are doing should be included. Thanks.
2006-08-03
05:10:44
·
10 answers
·
asked by
Rich
5
in
Programming & Design