How to print all the columns after a particular number using awk?

后端 未结 11 685
一生所求
一生所求 2020-12-22 20:23

On shell, I pipe to awk when I need a particular column.

This prints column 9, for example:

... | awk \'{print $9}\'

How can I tell

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 20:58

    awk '{print substr($0, index($0,$9))}'
    

    Edit: Note, this doesn't work if any field before the ninth contains the same value as the ninth.

提交回复
热议问题