awk to print all columns from the nth to the last with spaces

后端 未结 4 646
不知归路
不知归路 2021-01-23 21:26

I have the following input file:

a 1  o p
b  2 o p p
c     3 o p p  p

in the last line there is a double space between the last p\'s

4条回答
  •  甜味超标
    2021-01-23 22:12

    In Perl, you can use split with capturing to keep the delimiters:

    perl -ne '@f = split /( +)/; print @f[ 1 * 2 .. $#f ]'
    #                                      ^
    #                                      |
    #                              column number goes
    #                              here (starting from 0)
    

提交回复
热议问题