awk: printing a tab-delimited instead of a space-delimited file

Viewed 11126

I am using this awk command to print out certain columns of a file

awk '{print $1,$2,$3,$5,log($11),$12}' inputfile > outputfile

The inputfile is tab-delimited, and the outputfile is space-delimited. I need the outputfile to be tab-delimited as well. I tried this, but this still gives me a space-delimited file:

awk 'BEGIN{FS="\t"}{print $1,$2,$3,$5,log($11),$12}' inputfile > outputfile

What am I doing wrong? Many thanks!

1 Answers
Related