Maybe you could post the code you already have. Along with the information how big your files are

If your files are relatively small, you just read in the first file and put it into a hash. Use the first column as key and the rest of the line as value (use split() to split the line). Then read in the second file and look for the first column in the hash. Voila. Don't forget to check if the value exists (Use the exists() function).

If your files are too big to fit in memory, you have two possibilities:

1) Use a hash that is stored in a file, for example with DBM::Deep

2) Sort both files on disk (if you use linux or some other unix dialect, just use the sort program). Then you can compare them line by line. Again it is useful to check if a line is missing in one file, also you have to remove the table header before you sort the files.


In reply to Re: Combining tab delimited tables by jethro
in thread Combining tab delimited tables by gogoglou

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.