How to print last two columns using awk

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

All I want is the last two columns printed.

6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 19:53

    Please try this out to take into account all possible scenarios:

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

    or

    awk 'BEGIN{OFS="\t"}' file
    

    or

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

提交回复
热议问题