agianni, this worked marvelously and most importantly I picked up a few pointers on perl use. It now turns out that I have in my input multiple Servers (the 1st field) in addition to multiple Login ID's (the 3rd field) per Application (the 4th field). I am able to accumulate the Percent of Totals by Application with your code.

Sample output from your code would look as follows:

xsd00501,05/2007,"Shared Production (PRD,0.2% xsd00501,05/2007,OMX (old MBX userid),0.9% xsd00501,05/2007,PTI - Private Client Services,0.0% xsd00501,05/2007,SSG-IPM,3.1% xsd00501,05/2007,SSG-PMD-Omegamon,0.6% xsd00501,05/2007,SSG-RAC-Maestro ,45.7% xsd00501,05/2007,STW - Stock Transfer Workstation,1.1% xsd00506,05/2007,ADR,0.4% xsd00506,05/2007,OBR Production,0.1% xsd00506,05/2007,RAC/AMOS/DSO,43.3% xsd00506,05/2007,SPS - Inform,1.2% xsd00506,05/2007,SPS Production (also IRD till 7/03),11.7% xsd00506,05/2007,SSG-IPM,2.6% xsd00506,05/2007,SSG-PMD-Omegamon,0.6% xsd00506,05/2007,SSG-RAC-Maestro ,17.0% xsd00544,05/2007,"DB2DARI ""stored procedures"" prod",2.1% xsd00544,05/2007,BMW,0.0% xsd00544,05/2007,CTI Production ,21.7% xsd00544,05/2007,CTI,13.1% xsd00544,05/2007,Merva,0.0% xsd00544,05/2007,OMS,13.7% xsd00544,05/2007,PTI - Private Client Services,0.0% xsd00544,05/2007,SSG-IPM,4.5% xsd00544,05/2007,SSG-PMD-Omegamon,0.1% xsd00544,05/2007,SSG-RAC-Maestro ,2.6% xsd00722,05/2007,SSG-PMD-Omegamon,1.9% xsd00722,05/2007,SSG-RAC-Maestro ,23.1%

In addition, after the last Server entry, I need to output a TOTAL line with the Total Percentage for all Applications for a particular Server and Date. For the server/date combination (xsd00501,05/2007) above, a line after the last line with xsd00501,05/2007, would be printed totalling the percentages, as follows:

xsd00501,05/2007,TOTAL,51.6%

Up to this point in my limited perl programming experiences,I have been unable to grasp how to determine when a particular variable changes its value in the input and when this happens doing a particular task.

Any assistance would be greatly appreciated.


In reply to Re^4: Accumulating Column Total From a CSV for a Common Key Value by GeneV1
in thread Accumulating Column Total From a CSV for a Common Key Value by GeneV1

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.