This does not work, as I expect, despite all the research. Something is missing me ...
File 1 ...
File 2 ...
I am trying to join both second fields. When I do a left outer join and include only the fields from the first file, everything seems to be a dandy.
# join -1 2 -2 2 -a 1 -o 1.2 1.3 file1.csv file2.csv 123 JohnDoe 456 BobDylan 789 BillyJean
But as soon as I include the field from the second file, everything goes wrong.
# join -1 2 -2 2 -a 1 -o 1.2 1.3 2.3 file1.csv file2.csv DaddyDoeoe DaddyDylann 789 BillyJean DaddyJean
The last line looks perfect! What's up with others? Any ideas? Thanks in advance!
EDIT: Here is my attempt with actual CSV.
# cat file1.csv 1,123,JohnDoe 1,456,BobDylan 1,789,BillyJean # cat file2.csv 111,123,DaddyDoe 222,456,DaddyDylan 666,777,Stranger 555,789,DaddyJean 444,888,Stranger 333,999,Stranger # join -t, -1 2 -2 2 -a 1 -o 1.2 1.3 2.3 file1.csv file2.csv ,DaddyDoeoe ,DaddyDylann 789,BillyJean,DaddyJean