I am curious how I will read a word from a text file without a given structure (for example, notes or a small report) by word. For example, text can be structured as follows:
"05/06/1992
Today is a good day, the
Worm turned, and the battle was won."
I was thinking maybe getting a line using getline, and then see if I can break it into words with spaces. Then I thought using strtok might work! However, I do not think this will work with punctuation.
Another method I was thinking about was to get all char char and omit characters that were undesirable. But that seems unlikely.
So, to sort the short position: Is there an easy way to read input from a file and split it into words?
source
share