in reply to How do I create a list with the 10 most frequently used words in a file?

Here is the obligatory "one-liner" to get the top ten word frequency:
perl -anE "$c{$_}++ for @F}{ ++$top<11 && say qq|$c{$_}\t$_| for sort +{$c{$b}<=>$c{$a}} keys %c" YOUR-FILE.txt
Use single-quotes instead of double, for Linux.

                "It's ten o'clock... Do you know where your AI programs are?"

  • Comment on Re: How do I create a list with the 10 most frequently used words in a file?
  • Download Code