In AWK, is there a way to print all columns? I do not want to print them like this:
printf($1 $2 $3 ...)Is there a way to print all of them?
1 Answer
This will print all:
awk '{print $0}' And to make this long enough: this will print columns 3 to 6:
awk -v f=3 -v t=6 '{for(i=f;i<=t;i++) printf("%s%s",$i,(i==t)?"\n":OFS)}'OFS is a built-in variable (there are 8: FS, OFS, RS, ORS, NR, NF, FILENAME, FNR) and is the output field seperator (more here).
0