lokesha has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to get output as below, by adding matching values: Output:20100221, abc_1, 200 20100221, abc_4, 350 20100221, opq_3, 200 20100221, abc_5, 220 20100221, xyz_1, 500 20100221, abc_2, 500 20100221, abc_3, 100 20100221, xyz_2, 700 20100221, opq_2, 350 20100221, xyz_3, 100 20100221, opq_1, 230
I've started coding as below, but not able to continue due to lack of experience.20100221, abc, 1370 20100221, xyz, 1300 20100221, opq, 780
Could any of you help me to accomplish my requirement? Thanks and Regards / Lokeshause strict; use warnings; my $inputfilename = $ARGV[0]; ### CSV file name. ### open( my $in_fh, "<", $inputfilename ) or die "Can't open $inputfilena +me : $!"; while (my $line = <$in_fh>) { chomp($line); my @columns = split(',', $line, 2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Summing column values
by Ratazong (Monsignor) on Feb 24, 2010 at 08:50 UTC | |
|
Re: Summing column values
by baxy77bax (Deacon) on Feb 24, 2010 at 09:41 UTC | |
by BrowserUk (Patriarch) on Feb 24, 2010 at 10:25 UTC |