How to read many input files in AWK? -
this question has answer here:
i try understand how read many input files in awk puzzle "how can print 1st column file 1 , 2nd column file 2?
input
$ cat test1 1 4 2 5 3 6 $ cat test2 b c d e f
goal
$ awk **answer** 1 b 2 d 3 f
awk 'nr==fnr{a[nr]=$1;next} {print a[fnr], $2}' file1 file2
Comments
Post a Comment