in reply to How do I create a list with the 10 most frequently used words in a file?
this program shows the frequency of every word in the appeared order of the text fileNo, it doesn't. It's sorting the keywords alphabetically. It's eqivalent to
To sort by count use this sort blocksort { $a cmp $b } keys %count
For descending order reverse the sort operandssort { $count{$a} <=> $count{$b} } keys %count
sort { $count{$b} <=> $count{$a} } keys %count
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How do I create a list with the 10 most frequently used words in a file?
by Jannejannesson (Novice) on Apr 29, 2019 at 15:32 UTC |