Hi
I am able to match two files (fileA and B) based on the first column using this line.
awk -F"/t" 'NR == FNR { A[$1] = $0; next } A[$1] { print $0 FS A[$1] }'
However I now need to match the two files (files A and B) based on two columns. On top of that, for those that dont match, I want it to print out NA
eg of File A
Reb1 Go 10 9
Reb2 Gp 13 7
Yur8 Gk 10 2
eg of File B
Reb1 Go 3 8
Reb2 Gp 2 9
So I want to match column 1 and 2 but if there is no match at all I want it to say NA
so the output would look like this:
Reb1 Go 10 9 3 8
Reb2 Gp 13 7 2 9
Yur8 Gk 10 2 NA NA
thanks