I want to grep several words in file1, and use each word to grep what follows after its match in file2.fasta. And then I want to add the thing that followed the match to the word I used into file03, so that file03 contains information from both files. Part of files I have are:
file1:
Jan12345: ID1 ID2 ... IDN1
Jan67899: ID11 ID12 ... IDN2
And a Fasta file (file2) like this:
>ID1
ABCDEFG
>ID2
HIJKLMN
>IDN1
OPQRSTU
>ID11
WXYZABC
>ID12
DEFGHIJ
>IDN2
KLMNOPQ
The output I want is for this example:
Jan12345 ID1 ABCDEFG ID2 HIJKLMN ... IDN1 OPQRSTU
Jan67899: ID11 WXYZABC ID12 DEFGHIJ... IDN2 KLMNOPQ
As you can see, I simply want to add the FASTA sequence - which is contained in file2 – to file1. If anyone knows how to do this I would greatly appreciate it!