how to remove the first two columns in a file using shell (awk, sed, whatever)

前端 未结 10 2553
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 12:58

I have a file with many lines in each line there are many columns(fields) separated by blank \" \" the numbers of columns in each line are different I want to remove the fir

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 13:39

    This might work for you (GNU sed):

    sed -r 's/^([^ ]+ ){2}//' file
    

    or for columns separated by one or more white spaces:

    sed -r 's/^(\S+\s+){2}//' file
    

提交回复
热议问题