you are looking for spaces, this can be done as a space in a string or as a char. So in my opinion this would work.
(By the way, if the file contains sentences with dots. And someone forgot to add a space after the dot, the word will not be added to the total amount of words)