I have a long CSV file with two columns, which includes runs of consecutive duplicates like this:
... 1500,1533 1554,1678 1554,1703 1554,1728 1593,1766 ...
I need to delete all of these duplicates except for the last one - so the output for the example above would be:
... 1500,1533 1554,1728 1593,1766 ...
Also I need to keep the rest of the lines in the file in their original order.
tac file.csv | sort -k1,1 -r -u -t,
but this did not give the desired result, and sort based functions messed up my line order.