Thanks for responses, eventually I found a workaround using paste, but it would be good to see what I'm missing. That said I'm out of time to look at this myself
AnanthaP - I've tried various combinations of the appropriate syntax (starting with wild card and moving on to [0-9]). For example
Code:
awk '{ getline ln < /^[1-9].dat/ ; print ln" "$2 }' 4.dat > combined.dat
which only takes $2 from 4.dat, while
Code:
awk '{ getline ln < /^[1-9].dat/ ; print ln" "$2 }' *.dat > combined.dat
combined $2 but all into a single column.
grail, thanks, although for me
Code:
for file in *; do
awk '{ print $2 }' $f >> combine.dat;
done
just hangs.
Alex