I want to merge/join or produce a new merged file . Both files contain common IDs in the first column .
File 1 looks like this
ID Tb927.4.4670 Tb927.8.3630 Tb09.160.4310 Tb927.8.3650
File 2 contains the ID and also functions for each gene and looks like this
ID Function 1 Other field Tb09.211.0140 A eg Tb11.03.0080 B eg Tb927.8.6200 C eg Tb927.7.690 D eg
However, some IDs are missing in my file 2 as not all genes have known function so the fields in my file 2 are less than in my file 1. The IDs in file 2 are also sorted differently from my file 1.
I want my merged file to follow the sequence in my file 1 with merged functions in the output . For the missing ID, it can either be empty or something like return '-' .
Is it possible to merge this kind of files using linux command?