Word counter for text files