This question already has an answer here:
- Using awk, remove lines with duplicate pair of columns in different indexes 2 answers
I am trying to filter or remove some lines in a text file based on some criteria (tried with awk, but no success).
I have a file that contains some columns separated by a comma ,
. An example of such a file is:
source,destination
192.168.1.2,8.8.8.8
8.8.8.8,192.168.1.2
I am interested to remove or filter out those lines where the information is the same.
so if the file contains the reversed source destination:
192.168.1.2,8.8.8.8
8.8.8.8,192.168.1.2
then only show one of the lines, not both.