Extract specific columns from delimited file using Awk

后端 未结 8 1896
-上瘾入骨i
-上瘾入骨i 2020-11-28 05:44

Sorry if this is too basic. I have a csv file where the columns have a header row (v1, v2, etc.). I understand that to extract columns 1 and 2, I have to do: awk -F \

8条回答
  •  Happy的楠姐
    2020-11-28 06:38

    You can use a for-loop to address a field with $i:

    ls -l | awk '{for(i=3 ; i<8 ; i++) {printf("%s\t", $i)} print ""}'
    

提交回复
热议问题