Matching Ids with respect to individual file
1
0
Entering edit mode
5.5 years ago

Hi,

I have number of files having information related to gene and its positions. And I have a list of Ids with respect to the number of files. I want to extract data with respect to ids. But my problem is different. As, I want my first id get searched in only first file not on others.

For example I have multiple files (more than 14000) like this:

000002|chr1:1158623-1159348-|NM_016176|SDF4 0000002 ACTCAAAGTGGATGAGGAA +
0000003|chr1:1158623-1159348-|NM_016176|SDF4    0000002 ACTCAAAGTGGATGAGGA  +
0000004|chr1:1158623-1159348-|NM_016176|SDF4    0000002 ACTCAAAGTGGATGAGG   +
0000005|chr1:1158623-1159348-|NM_016176|SDF4    0000002 ACTCAAAGTGGATGAG    +

My list of ids file is like this

000002|
000003|
000004|

My desired output for one file would be like this

000002|chr1:1158623-1159348-|NM_016176|SDF4 0000002 ACTCAAAGTGGATGAGGAA +

Any help is much appreciated.

Thanks

next-gen • 799 views
ADD COMMENT
1
Entering edit mode
5.5 years ago
Joe 21k

grep is your friend for this. Google how to grep the contents of one file using another.

ADD COMMENT
1
Entering edit mode

excellent hint. I solved it by using grep in for loop.

Made my day!

Thanks

ADD REPLY

Login before adding your answer.

Traffic: 2524 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6