I want to merge/join or produce a new merged file . Both files contain common IDs in the first column .File 1 looks like thisIDTb927.4.4670Tb927.8.3630Tb09.160.4310Tb927.8.3650File 2 contains the ID and also functions for each gene and looks like thisID              Function 1    Other fieldTb09.211.0140     A               egTb11.03.0080      B               egTb927.8.6200      C               egTb927.7.690       D               egHowever, 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?
merge unsorted file to sorted file using shell command
text processing;merge;join