awk: printing a tab-delimited instead of a space-delimited file -
i using awk command print out columns of file
awk '{print $1,$2,$3,$5,log($11),$12}' inputfile > outputfile
the inputfile tab-delimited, , outputfile space-delimited. need outputfile tab-delimited well. tried this, still gives me space-delimited file:
awk 'begin{fs="\t"}{print $1,$2,$3,$5,log($11),$12}' inputfile > outputfile
what doing wrong? many thanks!
i think want ofs="\t"
, set output field separator.
Comments
Post a Comment