hi,
I have files with 2 columns of data
g1.dat
f1.dat
g2.dat
f2.dat
...
I know how to join g1.dat and f1.dat into one file with 4 columns. I do that like
awk 'FNR==NR {a[FNR]=$0;next}{print $1, $2, a[FNR]}' f1.dat g1.dat > f1g1.dat
I would like to do this in loop for each pair similarly like for f1.dat and g1.dat. I made a list with file names to be sure what I am joining like:
g1.dat f1.dat
g2.dat f2.dat
g3.dat f3.dat
....
How to use this list to join files in the loop?
thanks
oliver
I have files with 2 columns of data
g1.dat
f1.dat
g2.dat
f2.dat
...
I know how to join g1.dat and f1.dat into one file with 4 columns. I do that like
awk 'FNR==NR {a[FNR]=$0;next}{print $1, $2, a[FNR]}' f1.dat g1.dat > f1g1.dat
I would like to do this in loop for each pair similarly like for f1.dat and g1.dat. I made a list with file names to be sure what I am joining like:
g1.dat f1.dat
g2.dat f2.dat
g3.dat f3.dat
....
How to use this list to join files in the loop?
thanks
oliver