I need help to cross reference two files.
file1
Aplastodiscus_albofrenatus_CFBH5051
Aplastodiscus_albosignatus_MZUSPfield1451
Aplastodiscus_arildae_USNM303022
Aplastodiscus_cavicola_MNRJ63689
Aplastodiscus_cochranae_CFBH3001
file2
>12sval16s_Aplastodiscus_albofrenatus_CFBH5051
>12sval16s_Aplastodiscus_albosignatus_MZUSPfield1451
>12sval16s_Aplastodiscus_arildae_USNM303022
>12sval16s_Boana_palaestes_MUBI6795
>12sval16s_Boana_gladiator_MUBI5391
I want to append strings in file2 without ">" only if a match occurs between strings in file1 and strings after the first "_" in file2. The strings from file1 and file2 must be separated using space. The output should be something like this:
Aplastodiscus_albofrenatus_CFBH5051 12sval16s_Aplastodiscus_albofrenatus_CFBH5051
Aplastodiscus_albosignatus_MZUSPfield1451 12sval16s_Aplastodiscus_albosignatus_MZUSPfield1451
Aplastodiscus_arildae_USNM303022 12sval16s_Aplastodiscus_arildae_USNM303022
Aplastodiscus_cavicola_MNRJ63689
Aplastodiscus_cochranae_CFBH3001
I wonder if awk would help. Thank you in advance.
:)
file2
looks like? You only have the fasta header and no sequence?