Message Boards Message Boards

Count the total number of words in a Wolfram notebook?

Posted 5 years ago

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.

POSTED BY: Paul Davidson
3 Replies

What the meaning of "word" here??

POSTED BY: Murray Eisenberg

Paul, I hope this will help.

NotebookImport["xxx.nb", "Input" -> "InputText"];
StringSplit[%, RegularExpression["\\W+"]] // Flatten // Tally
POSTED BY: Kotaro Okazaki
Posted 5 years 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!

POSTED BY: Paul Davidson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract