Welcome to the Monastery!

You're going to find while here that you get very good answers when you ask specific questions, and questions that provide adequate background. The question you've presented doesn't tell us what exactly you're having difficulty with. If you really don't know where to begin, that's ok too, but you should state that, and we can get you started in the right direction. If you are having trouble with one step, that's fine too, but tell us what step.

It's often helpful to either provide a 10-15 line snippet of code you're having difficulty with, or a description of the basic framework of code you're contemplating so that we can offer suggestions. Again, if you have no code, and no framework in mind, it helps if you let us know that so we can start you down the framework road. Then you can dig into the documentation to figure out how to implement that framework. And undoubtedly you'll have questions along the way when you get to that point, at which time you'll be able to ask answerable questions.

With your current description, I would recommend the following framework:

  1. open each CSV file, and begin iterating over its records.
  2. open a results file too.
  3. Use Text::CSV to access individual fields from the record you're working on in the current iteration.
  4. Perform your calculations on the current record.
  5. Output the current record to your results file.
  6. Move onto the next record, repeat steps 3,4,5 and 6 until no more records are left.
  7. close the two input files and the output file.
  8. Do whatever else you need to do, and then you're done.

Hopefully that gets you going in the right direction, but feel free to ask more specific questions as you dig into solving each of these steps.


Dave


In reply to Re: file merge by davido
in thread file merge by nraymond

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.