If your File1 has 700,000 lines, rest assured that a hash can easily accommodate this number of lines or even many more — if the lines are sufficiently short, i.e., not thousands of characters!

One pitfall to avoid: When you read each line from your File1, it will have some kind of line-end delimiter, typically a newline. This will have to be removed (see chomp) before adding it to the lookup hash because a COA213345 field split from the beginning of a line in File2 will have no such delimiter. (Looking up a key in a hash (see exists) is essentially an  eq string exact equality operation.)

Perhaps take a look at some of the articles in the Input and Output section of the Monastery's Tutorials.


Give a man a fish:  <%-{-{-{-<


In reply to Re^5: Filtering Output from two files by AnomalousMonk
in thread Filtering Output from two files by vighneshmufc

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.