Given this input:
# 133 15
KBL 40.385 26.385 1.0000 S
KBL 23.846 9.289 1.0000 P
KBL 40.234 26.385 1.0000 S
# 133 4
KBL 40.234 28.566 1.0000 S
KBL 40.385 28.566 1.0000 S
KBL 23.846 12.032 1.0000 P
I wish to remove the duplicate rows, specifically where a value on either column 2 or column 3 is repeated. In other words, I wish to get this output:
# 133 15
KBL 40.385 26.385 1.0000 S
KBL 23.846 9.289 1.0000 P
# 133 4
KBL 40.234 28.566 1.0000 S
KBL 23.846 12.032 1.0000 P
I have tried awk '!a[$0]++' file.xy. However, that only removes the lines that are fully identical. I'm looking to only remove the lines that have repeated values in either columns two or three.
Using Awk, what would be the best way to remove these duplicate rows? Thanks.
$2. Not sure your spec is consistent with the posted data