This must surely be a trivial task with awk or otherwise, but it\'s left me scratching my head this morning. I have a file with a format similar to this:
awk
I would use Perl for this:
perl -nae 'print unless exists $seen{$F[1]}; undef $seen{$F[1]}' < input.txt
The n switch works line by line with the input, the a switch splits the line into the @F array.
n
a
@F