Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: count words from file

Given a text file like this one:

Lorem ipsum dolor qui ad labor ad labor sint dolor  tempor incididunt ut labor ad dolore lorem ad
Ut labor ad dolor lorem qui ad ut labor   ut ad commodo commodo
Lorem ad dolor in reprehenderit in lorem ut labor ad dolore eu in labor dolor
sint occaecat ad labor proident sint in in qui labor ad dolor ad in ad labor
  • Print out a report how many times each word appears.
  • Disregard case of the letters.
  • Show them in order of frequency.
words_and_spaces.txt
ad 13
labor 10
dolor 6
in 6
ut 5
lorem 5
qui 3
sint 3
dolore 2
commodo 2
eu 1
incididunt 1
tempor 1
reprehenderit 1
proident 1
ipsum 1
occaecat 1