# Count the total number of words in a Wolfram notebook?

Posted 1 year ago
2677 Views
|
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
Sort By:
Posted 1 year ago
 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!
Posted 1 year ago
 What the meaning of "word" here??
Community posts can be styled and formatted using the Markdown syntax.