I have two files as follows:
File1:
ABC_1 123 E + 7.595927 Anotation1
ABC_2 456 E - 7.369319 Anotation2
EFG_1 261 E - 7.259135 Anotation3
EFG_2 947 E - 5.021707 Anotation4
EFG_3 1 E + 7.398731 Anotation5
HIJ_1 12 E + 7.398731 Anotation6
HIJ_2 14 E - 5.496079 Anotation7
File2:
ABC_1 123 E + inclusion 0.165805338
ABC_2 456 E - inclusion 0.165805338
EFG_1 261 E - inclusion 0.165805338
EFG_2 947 E - inclusion 0.165805338
EFG_3 1 E + inclusion 0.165805338
LMN_1 21 I - exclusion 0.5
LMN_2 43 I - inclusion 0.3
Is there a way to create a join on both the files, such that the first 5 columns are retained as follows, assuming obviously that there will be some rows that won't have joins in each file, in that case first 4 columns will be retained irrespective of the file with other fields blank following a specific format as follows:
ABC_1 123 E + 7.595927 Anotation1 inclusion 0.165805338
ABC_2 456 E - 7.369319 Anotation2 inclusion 0.165805338
EFG_1 261 E - 7.259135 Anotation3 inclusion 0.165805338
EFG_2 947 E - 5.021707 Anotation4 inclusion 0.165805338
EFG_3 1 E + 7.398731 Anotation5 inclusion 0.165805338
HIJ_1 12 E + 7.398731 Anotation6 NULL NULL
HIJ_2 14 E - 5.496079 Anotation7 NULL NULL
LMN_1 21 I - NULL NULL exclusion 0.5
LMN_2 43 I - NULL NULL inclusion 0.3
I did try join -a 1 -a 2 -e NULL -o
command but it doesn't give me the desired order and format