pearlofperls
Technical User
I have :
5 columns in file 1
11 columns in file 2
file 1 has more lines than file 2
cols 1, 2, 4, match info between the two files
based on the critieria of matching cols i want to extract cols 3,5 from file 1 and add them with file 2
I think this code is close to what im looking to do
awk 'FNR==NR{a[$1,$2,$3]=$4" "$5;next}
{ print $1,$2,$3,a[$1,$2,$3]}' file2 file1
5 columns in file 1
11 columns in file 2
file 1 has more lines than file 2
cols 1, 2, 4, match info between the two files
based on the critieria of matching cols i want to extract cols 3,5 from file 1 and add them with file 2
I think this code is close to what im looking to do
awk 'FNR==NR{a[$1,$2,$3]=$4" "$5;next}
{ print $1,$2,$3,a[$1,$2,$3]}' file2 file1