awk - Remove line if field is duplicate
Posted
by Kyle
on Stack Overflow
See other posts from Stack Overflow
or by Kyle
Published on 2010-04-08T23:14:23Z
Indexed on
2010/04/08
23:23 UTC
Read the original article
Hit count: 287
Looking for an awk (or sed) one-liner to remove lines from the output if the first field matches.
An example for removing duplicate lines I've seen is:
awk 'a !~ $0; {a=$0}'
Tried using it for a basis with no luck (I thought changing the $0's to $1's would do the trick, but didn't seem to work).
© Stack Overflow or respective owner