Skip to content
Advertisement

Problem filtering 2 files using AWK for a given condition

First of all, thank you for your help. I have a problem filtering 2 files using AWK conditionals. The two files I want to filter are these one: Fasta.fa

JavaScript

species_id (the file is larger and contain the name of different species)

JavaScript

I want to use awk so it puts in fasta.fa the name of the species if both $2 in both files are the same in so the output in a new file will be something similar as this:

JavaScript

I have tried this two codes but none of them give the result I expect. Final file contains the same information as fasta.fa, so nothing has changed

JavaScript

Advertisement

Answer

You may use this awk:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement