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. |