Hi,

I'm trying to write a script that removes duplicates between two files and
writes the unique values to a new file. For example, have one file with the
following file 1:

red
green
blue
black
grey

and another file 2:

black
red

and I want to create a new file that contains:

green
blue
grey

I have written a script that takes each entry in file 1 and then reads
through file 2 to see if it exists there, if not, it writes it to a new
file. If there is a duplicate, nothing is written to the new file. The real
file 1 I'm dealing with has more than 2 million rows and the real file 2 has
more than 100,000 rows so I don't think my method is very efficient. I've
looked through the web and perl references and can't find an easier way. Am
I missing something? Any ideas?

Thanks,

Steve Whittle

Reply via email to