in reply to difficulty in multi sorting
texuser74,
you probably want to get the data into some structure before processing it. So why don't you read through your file and 'feed' a Hash of Array in a way like:
pelagic
you probably want to get the data into some structure before processing it. So why don't you read through your file and 'feed' a Hash of Array in a way like:
Then you can loop through the sorted hash keys and print the name together with all it's (sorted) codes.... my %hash; while (<IN>) { my $name = ... my $code = ... push @{ $hash{$name} }, $code; }
That's some sort of pseudo code, so it will not work as is. .. ;)foreach my $name (sort keys %hash) { print join (', ', $name, sort @{ $hash{$name} }), "\n"; }
pelagic
In Section
Seekers of Perl Wisdom