I have a file with a patter like this:
1 1 1 2 0 1 0.5
1 2 2 2 0 2 0.5
2 1 1 1 0 1 0.25
2 1 2 2 0 2 0.5
2 3 3 3 0 3 0.25
I want to remove a line if another line in the file has the same last two entries. In the example above this means that line 4 should be removed:
1 1 1 2 0 1 0.5
1 2 2 2 0 2 0.5
2 1 1 1 0 1 0.25
2 3 3 3 0 3 0.25
I can't get my head around how I can do this via the command line or with a simple awk/sed script. Any help is greatly appreciated!
try:
assuming the original order of the lines doesn't matters.