Given the files:
1.txt
1, abc, 123, 456, 789
2, lmn, 123, 456, 789
3, pqr, 123, 456, 789
2.txt
1, abc, 123, 000, 000
3, lmn, 123, 000, 000
9, opq, 123, 000, 000
OUTPUT.txt
ID, NAME, X, 1A, 1B, 2A, 2B
1, abc, 123, 456, 789, 000, 000
2, lmn, 123, 456, 789, MISSING, MISSING
3, pqr, 123, 456, 789, 000, 000
9, opq, 123, MISSING, MISSING, 000, 000
I'ved used this for reference.
I tried using the following:
join -t , -a1 -a2 -1 1 -2 1 -o 0 -o 1.2 -o 1.3 -o 1.4 -o 1.5 -o 2.4 -o 2.5 -e "MISSING" 1.txt 2.txt
Which produces:
1, abc, 123, 456, 789, 000, 000
2, lmn, 123, 456, 789,MISSING,MISSING
3, pqr, 123, 456, 789, 000, 000
9,MISSING,MISSING,MISSING,MISSING, 000, 000
Any help?