I was trying to use awk to convert a space delimited file into a tab delimited file. To my surprise this didn\'t work as expected:
awk -vOFS=$\'\\t\' \'{print}\'
Try this:
awk -v OFS='\t' '{$1=$1}1' file
If you just set OFS, it does not do anything. By setting $1 to $1 it will use the OFS since field has changed. 1 is always true, so it will print the line. Same as {print}
$1
1
{print}