How to print last two columns using awk

后端 未结 6 1304
甜味超标
甜味超标 2021-01-29 19:16

All I want is the last two columns printed.

6条回答
  •  无人共我
    2021-01-29 19:52

    You can make use of variable NF which is set to the total number of fields in the input record:

    awk '{print $(NF-1),"\t",$NF}' file
    

    this assumes that you have at least 2 fields.

提交回复
热议问题