A match is when the number (date) in datafile2 is within the range values in datafile1. So, for example, 200110100 in datafile2 is a match because it is within CDC Inc. 200110014 - 200110325 range. So the output file would include the '200110100,some text here,etc' line.

I am still debating how the output should look like. One option is to break the output into 2 files--(1) a matched results file that includes the header of datafile2 and all the matched lines and (2) a reports summary file that displays some metadata... such as, how many total records processed, how many such records belong to each company and how many in each range. The other alternative is to display something like this:

#ABC Corp. 200210100,some text here,etc #1 record found for the 20021 range id. 200211015,some text here,etc ... #x records found for the 20022 range id: #x total records found for ABC Corp. #CDC Inc. ... #57 total records found

Let me know what you think.

Thanks!

David


In reply to Re: Re: Code efficiency / algorithm by dave8775
in thread Code efficiency / algorithm by dave8775

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.