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

后端 未结 11 705
一生所求
一生所求 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:57

    sed -re 's,\s+, ,g' | cut -d ' ' -f 9-
    

    Instead of dealing with variable width whitespace, replace all whitespace as single space. Then use simple cut with the fields of interest.

    It doesn't use awk so isn't germane but seemed appropriate given the other answers/comments.

提交回复
热议问题