Re: Using PHP to get a word count of a MSword doc
| From: | Erik Price | Date: | Tue, 18 Mar 2003 21:45:47 +0000 |
| Subject: | Re: Using PHP to get a word count of a MSword doc | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140202@lists.php.net to get a copy of this message | ||
Brad Wright wrote:
Thanks for the reply Rene, Any change of a code sample of how u did this?? Im not at all experienced in Java.According to the manual, PHP does have some tokenizer functions: http://www.php.net/manual/en/ref.tokenizer.php However, the documentation appears to be lacking as they are still under development. Using it might be somewhat straightforward if you are accustomed to using a tokenizer in another language (like Java) but if not, it's really a little too difficult to explain in an email. A less elegant but ultimately quicker and probably more reliable solution might be to investigate some kind of external word-counting program that knows how to parse .DOC files (good luck on that part), and call this from your PHP script using system(). Catch-22: the only libraries I am familiar with that can parse .DOC files are the Jakarta POI libraries, which are written in Java. But I am sure that if you scour the web you can find some Perl, Python, or maybe even PHP-based solution. Erik