views:

98

answers:

3

Hi all,

I really need to work with information contained in word perfect 12 files without using WP's sluggish visual interface, but I can't find any detailed documentation about the file format or any python modules for reading/writing the files. I found a post on the web that seems to explain how to convert WP to text, but I didn't understand much about how it works.

http://mail.python.org/pipermail/python-list/2000-February/023093.html

Does anyone have any advice or info on how to accomplish this?

Thanks in advance,

Thom

+2  A: 

OpenOffice.org should read WordPerfect files, I think.

And you can script OOo with python.

I have no experience in either, though, so I can't offer more help.

John Fouhy
+2  A: 

The relevant part of your link is this:

os.system( "%s %s %s" % ( WPD_TO_TEXT_CMD, "/tmp/tmpfile", "/tmp/tmpfile.txt" ) )

Which is making a system call to an outside program called "wp2txt". Googling for that program produces active hits.

Mark
Active hits are mostly for wikipedia dump files to text, I think you want: http://alter.org.ua/en/soft/win/convert/
Tristan
+1  A: 

Ok, here's what I did. I read the file in binary mode, converted by the data into a string representation of the hex values, and used unofficial WP documentation to create regular expressions to swap out all the hex strings representing non-text formatting codes and meta data, then converted everything back into text. A dirty piece of hacking, but got the job done.

twneale
Lame to accept my own answer, I know.
twneale