Use Unix JOIN command to merge two files
You used the -a
option.
-a
file_numberIn addition to the default output, produce a line for each unpairable line in file file_number.
In addition, the odd overwriting behavior indicates that you have embedded carriage returns (\r
). I would examine those fies closely with cat -v
or a text editor that doesn't try to be "smart" about Windows files.