Have a nice day, j#!/usr/bin/perl use strict; use warnings; # Read data from file my $file = shift @ARGV; die "Usage: $0 <data-file>\n" unless $file; open FH, "<", $file or die "Can't open '$file': $!\n"; # Cristoforo's code (same as above) my %data; while (<FH>) { chomp; my ($v, $k) = split /,/; $data{ $k } += $v; } close FH; print "$data{$_},$_\n" for sort keys %data;
In reply to Re^2: Alphanumeric sort
by reisinge
in thread Alphanumeric sort
by zac_carl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |