0

how to filter duplicate statements in files

hello..,

i tried to filter duplicate statement presented in file and also tried to printed only 3rd column statement. it will worked by this command # awk ' {print $3}' file.txt | sort -u. here i used two syntax to get this output. Is there any alternate command to print this statement in single command.

CentOS sort awk Ubuntu UNIX Add a comment
yousuf
asked Sep 28 2017

Answer

0

i think this command work for you... # awk '!x[$3]++ { print $3 }' file.txt

Add a comment
arunkumarak
asked Sep 29 2017
edited Oct 05 2018
Post your Answer