awk command for simple join command but based on 2 columns

input1

a_a    a/a    10    100
a1    a_a    20    200
b1    b_b    30    300

input2

a_a    a/a    xxx    yyy
a1    a1    lll    ppp
b1    b_b    kkk    ooo

output

a_a    a/a    10    100    xxx    yyy
b1    b_b    30    300    kkk    ooo

One way in awk:

awk 'NR==FNR{A[$1,$2]=$3t$4;next} A[$1,$2]{print $1t$2t A[$1,$2] t$3t$4}' t="\t" file1 file2

Output

a_a     a/a     10      100     xxx     yyy
b1      b_b     30      300     kkk     ooo

Thank you soo soo much. It's working great! :wink: