word-count

How can I use the UNIX shell to count the number of times a letter appears in a text file?

I have a few text files and I'd like to count how many times a letter appears in each? Specifically, I'd like to use the UNIX shell to do this, in the form of: cat file | .... do stuff... Is there a way I can get the wc command to do this? ...

PHP and regular expressions: how to get the character count of all characters in a string containing HTML, but measuring only 20 visible words?

I am working on a WordPress site where one of the pages lists excerpts about corporate clients. Let's say I have a web page where the visible text looks like this: "SuperAmazing.com, a subsidiary of Amazing, the leading provider of integrated messaging and collaboration services, today announced the availability of an enhanced version...

How can I count words in complex documents (.rtf, .doc, .odt, etc)?

I'm trying to write a Python function that, given the path to a document file, returns the number of words in that document. This is fairly easy to do with .txt files, and there are tools that allow me to hack support for a few more complex document formats together, but I want a really comprehensive solution. Looking at OpenOffice.org'...