I have data like:
Blue Apple 6
Red Apple 7
Yellow Apple 8
Green Banana 2
Purple Banana 8
Orange Pear 11
What I want to do is if $2 in a row is the same as $2 in the previous row remove that row. An identical $2 may exist more than one time.
So the out file would look like:
Blue Apple 6
Green Banana 2
Orange Pear 11
I'm new and don't really have any idea about the type of code that would work or if this would require something like Perl.
Thank you for your help.