How remove the dupclicated columns¶ Using awk¶ Sometimes columns are duplicated in your text file. You can easily remove these duplicates using awk awk 'NR==1{for(i=1;i<=NF;i++)b[$i]++&&a[i]}{for(i in a)$i="";gsub(" +"," ")}1'