How to pass a variable to an awk print parameter...
- by Jamie
I'm trying extract the nth + 1 and nth + 3 columns from a file.
This is what tried, which is a useful pseudo code:
for i in {1..100} ; do awk -F "," " { printf \"%3d, %12.3f, %12.3f\\n\", \$1, \$($i+1), \$($i+3) } " All_Runs.csv > Run-$i.csv
which, obviously doesn't work (but it seemed reasonable to hope).
How can I do this?