Count The Number Of Words In A PDF File
Answer : Quick Answer: pdftotext myfile.pdf - | wc -w Long Answer: If on Unix, you can use pdftotext : http://linux.about.com/od/commands/l/blcmdl1_pdftote.htm and then do the word count in the generated file. If on Unix, you can use: wc -w converted-pdf.txt to get the word count. Also, see the comment by frabjous - basically, you can do it in one step by piping to stdout instead to a temporary file: pdftotext myfile.pdf - | wc -w This is a hard task not not easy to solve. If you really want an exact result, copy paragraph by paragraph for your PDF viewer into a text file and check it with the wc -w tool. The reason why not to use pdftotext in that case is: mathematical formulas may get also into the output and regarded as "words". (Alternatively you could edit the output you get from pdftotext ). Another reason why this may fail are the headings: "4.3.2 Foo Bar" is counted as three words. A way around is only to count words starting with a char out of [A-Za-...