The input file is as below
827 819
830 826
828 752
756 694
828 728
821 701
724 708
826 842
719 713
764 783
752 828
694 756
#$1 is my first row and $2 is my second row. I am trying to omit rows such as 11th row which is the same as the 3rd row but with swapped values. Basically, for every $1 $2 that also has $2 $1, I want to omit the latter. This is just a snippet of the data. There are many such values in the actual dataset.`
I have tried the below:
awk -F “ “ ‘{ for i in cat 686.edges.txt | if [ expr $1 $2 == expr $2 $1 ] then #Evaluating the condition from file
and
awk -F “ “ ‘{ print $2 $1 }’ >> t.txt else ‘{ print “ Not found “ } fi #Printing all the $y $x into a file
and
awk -F “ “ ‘{ for i in cat t.txt} | grep -v "$1 $2" 686.edges.txt >> new.txt
I am reading inputs from t.txt which is the result of the previous operation and removing all of them from the main file and writing it in new.txt
I am unable to execute as I have been getting errors. Can anybody evaluate the above and correct me.
"and') and not the "smart" quotes (“and‘) that are in your question