Delete columns from space delimited file where file header matches

后端 未结 5 1570
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-25 13:58

I have a space delimited input text file. I would like to delete columns where the column header is size using sed or awk.

Input File:

id quantity colour         


        
5条回答
  •  情书的邮戳
    2021-01-25 14:24

    Use cut:

    $ cut -d' ' -f1-4,6,7,9,10 < in.txt   
    id quantity colour shape colour shape colour shape
    1 10 blue square red triangle pink circle
    2 12 yellow pentagon orange rectangle purple oval
    

提交回复
热议问题