Hi all,
Is it possible to count the number of words/characters in a document ?
Thanks a lot
Joelmo
Counting the number of characters in a document
Re: Counting the number of characters in a document
For Word documents, yes.
Please try the Word Count and Character Count properties in Everything 1.5.
For text/plain documents you could go off the filesize.
Please try the Word Count and Character Count properties in Everything 1.5.
For text/plain documents you could go off the filesize.
-
- Posts: 684
- Joined: Wed Jan 05, 2022 9:29 pm
Re: Counting the number of characters in a document
Hello Joelmo;
The answer to your question is obviously "Yes".
The Value of the count will depend on how you define "document".
Some six years ago I wrote a utility to search MSWord2003 documents and templates for specific words. I wrote "I don't get it. I'm brilliant, but not that brilliant. Why is my Word/VBA-written search faster than Microsoft's by a factor of about 45?".
My technique was to NOT open the Word document as a document, but to load the file as a string, as a file of binary data, if you will.
A byproduct of this was that I was able to locate text that had been deleted from MSWord documents; the text is not deleted but is merely bypassed.
Applying this technique would change the value of your word- or character-count.
I have made a copy of a PDF file available as www.ChrisGreaves.com/Downloads/FasterandFASTERsearches.pdf because it seems that only image files can be uploaded here as attachments.
Cheers, Chris