This is a common operation which perl is will suited for. Whenever you want to look read in one file and look up associated information in another file, it will involve using a hash to "index" the second file so you can find the information quickly. The basic recipe is:
for each line of the second file: parse it and locate the key store the second line in a hash indexed by its key endfor for each line of the first file: parse it and locate its common key with the second file look up the associated line using the hash do something with both lines endfor
Examples of how to do each of these steps can be found in these nodes:
Re: Combine files, while parsing info. (see the example in the <readmore> section
Re: compare data between two files using Perl

Your problem is complicated by the fact that you have several files you want to "join" together, but the basic approach won't change. This is similar to a "relational join" operation between tables in database parlance.


In reply to Re: Searching and Parsing Biological data by pc88mxer
in thread Searching and Parsing Biological data by biomonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.