Deb wrote:
> Hi,
>
Hi,
> I have a file in the following format, mm/dd/yy,decimal_number.
>
>
> 07/01/02,8419
> 07/02/02,6344
> 07/03/02,6487
> 07/04/02,719
> 07/05/02,3768
> 07/06/02,1270
> 07/07/02,7
> 07/08/02,5179
> 07/09/02,9990
> 07/10/02,7968
> 07/11/02,7605
> 07/02/02,8892
> 07/03/02,5550
> 07/04/02,6483
> 07/05/02,786
> 07/06/02,4094
> 07/06/02,954
> 07/07/02,6
> 07/09/02,5232
> 07/10/02,10405
> 07/11/02,7600
> 07/12/02,7581
>
> What I need to do is key on the date, then sum the numbers for the
> date, then send the date and sum to a file of the same format as above.
>
> So far, I've got this,
>
> $File = $ARGV[0];
> open (F, "$File") || die "Oops, did you type the right filename?\n";
>
> while (<F>) {
> ($date, $number) = split "," ;
> push (@{$numbers{$date}}, $number);
WHY ?? If you are interested only in the sum do
$numbers{$date} +=$number;
> }
>
Here your %numbers hash contains the data you need
> Does that look right? I'm not sure how to go from here. I really have
> a hard time understanding how to manipulate hashes. The syntax kills my
> brain.
>
> Any help would probably make my head quit hurting so much!
>
> deb
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]