I need to extract the key-words containing row from an excel file (.xls) as per the order specified in the given key-word file. For example I have an excel file namely genome.xls as given below,
NC_0208.1 18918 94692 amyl4_A0A0H 1 54 194
NC_0208.1 18839 86123 prot4_A0A0 1 79 137
NC_0208.4 29761 74985 lip10_H8FLU5 2 393 48
NC_0208.2 29687 67745 lysin6_A0A0Q5 5 38 49
And I have a key word file namely id.txt as given below,
prot
lip
cellulase
lysin
amyl
The expected output is
NC_0208.1 18839 86123 prot4_A0A0 1 79 137
NC_0208.4 29761 74985 lip10_H8FLU5 2 393 48
NC_0208.2 29687 67745 lysin6_A0A0Q5 5 38 49
NC_0208.1 18918 94692 amyl4_A0A0H 1 54 194
In addition to this, if the key-words are not there in genome file, it should leave the entire row as empty in the output file. Inorder to do this, I used grep command as follows,
grep 'prot\|lip\|cellulase\|lysin\|amyl' genome.xls > result.xls
Above mentioned command is extracting the key word containing entire row, but the order has been changed. Moreover, it is not leaving an empty row for the missing key words. Therefore, kindly help me to do the same. Thanks in advance.