Select a particular column using awk or cut or perl

后端 未结 4 1167
天涯浪人
天涯浪人 2021-02-04 03:20

I have a requirement to select the 7th column from a tab delimited file. eg:

cat filename | awk \'{print $7}\'

The issue is that the data in th

4条回答
  •  长情又很酷
    2021-02-04 04:04

    If fields are separated by tabs and your concern is that some fields contain spaces, there is no problem here, just:

    cut -f 7
    

    (cut defaults to tab delimited fields.)

提交回复
热议问题