I have a very simple tab delimited file containing text and numbers ,
just the 2 columns and I would like to sort by ascending numeric. I have
checked Learning Perl and Prog Perl but cannot get it to work - is that
because you can only sort by key or am I using the wrong approach
entirely?
my @fields = qw/Text Time/;
my %ch;
foreach my $key (sort { $ch{1} cmp $ch{2} } keys %ch ) {
print OUT "$key: $ch{$key} \n"; # show key and value
}
Thanks,
Mark Bedish
- Re: sort by value? Mark Bedish
- Re: sort by value? dave hoover
- Paging the Data.. Rajeev Rumale
- Re: Paging the Data.. Chas Owens
- Re: Paging the Data.. Abdulaziz Ghuloum
- Re: Paging the Data.. Maxim Berlin
- Re: sort by value? Hasanuddin Tamir
- Re: sort by value? Paul Johnson
- Re: sort by value? Paul
- Re: sort by value? Paul
- RE: sort by value? John Edwards
