Print lines that have no duplicates in a file and preserve sort order linux
Advertisements I have the following file: 2 1 4 3 2 1 I want the output like this (unique lines that don’t have any duplicates and preserve order): 4 3 I tried sort file.txt | uniq -u it works, but output is sorted: 3 4 I tried awk ‘!x[$0]++’ file.txt it keeps order, but it… Read More Print lines that have no duplicates in a file and preserve sort order linux