in reply to xtracting unique lines

Read the file.
Make a hash.
Split the line.
Check each part, if it exists in the hash.
If not, fill the fields into the hash.
Have fun while doing it!