I have multiple .dat files, which i will get to know dynamically. dat file will have two columns seperated by comma. Will be like key value pairs. For example:
File1:
entry1,100
entry2,200
entry3,300
File2:
entry1,500
entry3,750
Now I want the output as
File3:
entry1,100,500
entry2,200
entry3,300,750
Assuming you want to include unpairable lines from both files - such as
entry2,200
fromFile2
the following command should work:-t,
instructs join to use comma as a delimiter,-a1 -a2
instructs join to include unpairable lines from each file.You can use awk when input files are not already sorted: