Hi,
I have a little problem with the 'grep' tool. I have two files:
- pattern_file:
id_gene_1
id_gene_2
id_gene_3
- description_file:
id_gene_1 description_xxx
id_gene_2 description_yyy
id_gene_1 description_xxx
id_gene_3 description_zzz
id_gene_3 description_zzz
id_gene_2 description_yyy
I would like for each line of the 'pattern_file', look for the first match in the 'description_file'. I thought using the -f and -m grep option but I only get the first match.
Any idea ?
Thanks in advance
It's a good practice to give an example of your expected output. This is very helpful to have the desired answer. For other hand I would recommend you to have a look to stackoverflow forum since I'm pretty sure that this kind of question has been already asked before.
i'm confused. you said you want first matched, but only get the first match??
To be more precise, the 'description_file' looks like this:
description_file:
So, as output, I would like to have :
Please use
ADD COMMENT/ADD REPLY
when responding to existing posts to keep threads logically organized.In this case you should have edited your original post and added the information there.