Deleting columns from a file with awk or from command line on linux

前端 未结 4 771
伪装坚强ぢ
伪装坚强ぢ 2020-12-28 15:46

How can I delete some columns from a tab separated fields file with awk?

c1 c2 c3 ..... c60

For example, delete columns be

4条回答
  •  不知归路
    2020-12-28 16:13

    Perl 'splice' solution which does not add leading or trailing whitespace:

    perl -lane 'splice @F,3,27; print join " ",@F' file
    

    Produces output:

    c1 c2 c30 c31
    

提交回复
热议问题