Answers for "awk print range of columns"

0

awk print range of columns

$ awk -v b=2 -v e=7 'BEGIN{FS=OFS=","} {for (i=b;i<=e;i++) printf "%s%s", $i, (i<e ? OFS : ORS)}' file
column2,column3,column4,column5,column6,column7
Posted by: Guest on November-18-2020

Browse Popular Code Answers by Language