Converting .doc to .txt in Linux

William Purcell williamhpurcell at
Fri Sep 5 02:14:10 CEST 2008

Here is a function that I have used with wvText to convert .doc files into
text files.

def readdoc(fpath):
    tmp = 'tmp_readdoc.txt'
    cmd = 'wvText %s %s'%(fpath,tmp)
    lines = open(tmp,'r').readlines()
    return lines

It's not a completely python dependent function but it might work in a
pinch. It depends on wv. I have tried the python uno and the Danny OOoLib
modules, which might be worth looking into but I didn't have much luck.

If you find a better or a completely python dependent method, let me know.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list