output the 2nd column of a file

前端 未结 4 859
孤独总比滥情好
孤独总比滥情好 2020-12-30 01:15

given a file with two columns, separatedly by standard white space

a b
c d
f g
  h

how do I output the second column

4条回答
  •  一整个雨季
    2020-12-30 01:39

    Because the last line of your example data has no first column you'll have to parse it as fixed width columns:

    awk 'BEGIN {FIELDWIDTHS = "2 1"} {print $2}'
    

提交回复
热议问题