You're replying to a comment by paddy1.

paddy1 Permalink
June 23, 2011, 21:40

I have this file (using Sun OS) and need to delete rows if fields 1 and 3 are repeated

$ cat tt
yy|red|12|500|55
rr|red|12|500|55
yy|yellow|12|600|55
rr|yellow|13|600|55

Expecting output to be

rr|red|12|500|55
rr|yellow|13|600|55

And using this command - nawk '!x[$1,$3]++' FS="|" tt
But it's just cleaning up the 3rd line !!! I just picked up the command from somewhere so not sure what needs to be changed. Help is appreciated :)

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "sandbox": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.