Daily Archives: September 2, 2017

swapping two columns with awk keeping tabulation

Assuming you have a data file with N columns and you want to swap the first and second one, just type: awk -F $’\t’ ‘ { t = $1; $1 = $2; $2 = t; print; } ‘ OFS=$’\t’ input_fileawk … Continue reading

Posted in Linux | Tagged | Leave a comment