Count and display the frequency of words in a text file