I have two file. I want to have them merged based of 2 keys. There can be multiple records having the same key. if the second file doesn't have a record for the Key, the firse file record will be present in the output will blank for second file.
How can we do it in Awk without using unix JOIN.
Main file
20,2,A
10,2,B
20,3,C
10,2,D
20,3,E
10,3,F
Reference file
10,1,A1
10,2,A2
10,3,A3
20,2,B1
Output file
B1,20,2,A
A2,10,2,B
,20,3,C
A2,10,2,D
,20,3,E
A3,10,3,F
How can we do it in Awk without using unix JOIN.
Main file
20,2,A
10,2,B
20,3,C
10,2,D
20,3,E
10,3,F
Reference file
10,1,A1
10,2,A2
10,3,A3
20,2,B1
Output file
B1,20,2,A
A2,10,2,B
,20,3,C
A2,10,2,D
,20,3,E
A3,10,3,F