Counting the number of characters in a document

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Joelmo
Posts: 11
Joined: Sun May 09, 2021 3:27 pm

Counting the number of characters in a document

Post by Joelmo »

Hi all,

Is it possible to count the number of words/characters in a document ?

Thanks a lot
Joelmo
void
Developer
Posts: 16756
Joined: Fri Oct 16, 2009 11:31 pm

Re: Counting the number of characters in a document

Post by void »

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.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: Counting the number of characters in a document

Post by ChrisGreaves »

Joelmo wrote: Fri Jul 08, 2022 5:48 am Is it possible to count the number of words/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
Post Reply