in reply to Re: Find duplicate lines from the file and write it into new file.
in thread Find duplicate lines from the file and write it into new file.

This will fail for "second" duplicates that map to the same MD5:

Assume that two inputs i1 and i2 map to the same hash (m1), then your code will correctly discard all duplicate instances of i1 but incorrectly keep all instances of i2 for the following input:

i1 i2 i2 i2

You will need to keep a list of the offsets for each MD5, at least for every unique line encountered.