At 9:58 PM -0600 3/22/11, Chris Stinemetz wrote:
Jim,

You hit it right on. This is exactly what I am trying to do.

OK. With this information and that from previous posts, your requirements may be summaryized as follows:

You have a file with one record per line, each line consisting of a number of fields. Within each record may be found values of cell, sect, carr, and rlptxat at fixed column positions (e.g. 44 for rlptxat). You with to sum up the values of the rlptxat field for all records having the same values of cell, sect, and carr.

 Correct?

I took your advice but I am still unable to get the results I want.

Below is what I have with your code added. I also changed it from $fh to <DATA> so you can get an idea of the input data
and copy and paste it if you need to.


But you commented out my code, and deleted the part that prints the results. Your code does not sum anything. You don't need to sort the records to produce a sum.

Run your data through my code and see what you get. Then explain why it does not do what you want.

--
Jim Gibson
j...@gibson.org

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to