Message Boards Message Boards


Count the total number of words in a Wolfram notebook?

Posted 1 year ago
3 Replies
4 Total Likes

Hi It's all in the title of this post. This is a trivial matter in Word but I cannot see how to do it simply in a notebook. This is required for my university project.

3 Replies

Paul, I hope this will help.

NotebookImport["xxx.nb", "Input" -> "InputText"];
StringSplit[%, RegularExpression["\\W+"]] // Flatten // Tally
Posted 1 year ago

Kotaro, thanks for the suggestion but it doesn't help much I just get back a whole notebook filled with characters which must be the formatting instructions. Murray, I mean words in the sense of a report that needs to be maximum 3000 words long excluding the mathematics. In fact the solution I have used is to save as a pdf, open in Word and press the word count button. However it is not very elegant and if MS can do it at the touch of a button then why not Wolfram!

What the meaning of "word" here??

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract