Hi Rob,
You may be able to avoid the excel2txt program by exporting the excel sheet as a comma separated value (CSV) file.
You could then set the field separator in awk to extract the columns
#!/bin/bash
for i in 31 32 34 37; do
for j in 1 2 3 4 6 7; do
cat $i.csv | awk 'BEGIN { FS = "," } ; { print $'$j'}' > $i.$j.1D
done
done
If your lines (aka records) do not end in newline characters you can change it by specifying a custom record separator. For example, awk 'BEGIN { FS = "," ; RS="\r" } ; { print $'$j'}' > $i.$j.1D which I think should work, though I've not tried it.
Bye,
Colm.