I have two files--file1 and file2 that I want to join but some fields are missing in second file for which I want to insert string 'null'. One requirement is that the keys must be in the same order as in file1.
The input files and expected output result are as below:
file1.txt file2.txt
a 7 nah a anau
b 0 blah c bau
c 5 bah d cau
d 1 gah
e 0 hah
Expected output result:
a 7 nah anau
b 0 blah null
c 5 bah bau
d 1 gah cau
e 0 hah null