Tab separated values in awk

后端 未结 6 1573
一向
一向 2020-11-30 21:40

How do I select the first column from the TAB separated string?

# echo \"LOAD_SETTLED    LOAD_INIT       2011-01-13 03:50:01\" | awk -F\'\\t\' \'{print $1}\'         


        
6条回答
  •  时光取名叫无心
    2020-11-30 22:05

    You can set the Field Separator:

    ... | awk 'BEGIN {FS="\t"}; {print $1}'
    

    Excellent read:

    https://docs.freebsd.org/info/gawk/gawk.info.Field_Separators.html

提交回复
热议问题