setting the output field separator in awk

后端 未结 2 871
面向向阳花
面向向阳花 2020-12-09 09:32

I\'n trying this statement in my awk script (in a file containing separate code, so not inline), script name: print-table.awk

BEGIN {FS = \"\\t\";OFS = \",\"         


        
2条回答
  •  盖世英雄少女心
    2020-12-09 09:58

    You need to alter one of the field in awk:

    awk 'BEGIN {FS="\t";OFS=","; print "about to open the file"} {$1=$1}1' file
    

提交回复
热议问题