So, I have a common text file with some letters in it, it really varies in random order, but I also have a list of words that I want to compare with it and count the occurrences of each word that appears in the text file that is on list of words.
For example, my list of words may consist of this:
good
bad
cupid
banana
apple
Then I want to compare each of these individual words with my text file, which could be like this:
Sometimes I travel to the good places that are good, and never the bad places that are bad. For example I want to visit the heavens and meet a cupid eating an apple. Perhaps I will see mythological creatures eating other fruits like apples, bananas, and other good fruits.
I want my output to generate how many times each occurrence of the listed words occurs. I have a way to do this: awkand for-loop, but I really want to avoid it for-loop, as it will be forever, since my list of real words is about 10,000 words.
, ( ) 9, .
, .