http://qs321.pair.com?node_id=305320

zakzebrowski has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I have a pesudo perl related question, which is how do I bulk convert word perfect documents to text? I've tried two approaches, none of which work in all cases... One approach is to use the program "wpd2sxw", which takes a word perfect document, and converts it to an sxw file, which really is a jar and an xml description file, which, useing File::Find and a bunch of system calls, I was reasonably able to bulk convert documents to text reasonably well. The problem is, is that this method does not support earlier word perfect versions.

I then tried using Microsoft Word & Win32::OLE, File::Find, Win32::Process, Win32::Process::Info to import and export Word Perfect Documents to text. I do this by starting microsoft word via ole, open a document, copy and paste the text contents (word is strange) into a new document, save that document as text, and it seems to work fine. The problem is that I've been getting a bunch of error messages, which, when they ocurr, require special handeling. (In one case a dialogue box comes up, which you press ok, which I can't trap for, and in another case a ole exception is raised, which I can trap for...) Plus this method take a *long* time to process, so I'm looking for something better...

This has led me to yet another google search. From what I can tell, correll ships "cv.exe" and "convert.exe" which converts wpd documents to text, however, they are not available in the current word perfect installation, (or, they are not available in the install we're using...)...

So, before I start the while(1){$me->bangHeadAgainstWall();} loop, is there any better way of doing this?

Cheers, Zak


----
Zak
undef$/;$mmm="J\nutsu\nutss\nuts\nutst\nuts A\nutsn\nutso\nutst\nutsh\ +nutse\nutsr\nuts P\nutse\nutsr\nutsl\nuts H\nutsa\nutsc\nutsk\nutse\n +utsr\nuts";open($DOH,"<",\$mmm);$_=$forbbiden=<$DOH>;s/\nuts//g;print +;