Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Opening MS Word files via Python

Reply
Thread Tools

RE: Opening MS Word files via Python

 
 
Tim Golden
Guest
Posts: n/a
 
      04-21-2004
>I am curious as to how I should approach this issue. I would just
>want to parse simple text and maybe perhaps tables in the future.
>Would I have to save the word file and open it in a text editor? That
>would kind of....suck... Has anyone else tackled this issue?


Have a look at antiword: http://www.winfield.demon.nl/

It's not written in Python (afaik) but it writes to stdout.
Example:

<code>
import os

ANTIWORD = "c:/antiword/antiword.exe"
filename = raw_input ("Enter name of word doc: ")
text = os.popen ("%s %s" % (ANTIWORD, filename)).read ()

print text
</code>

TJG


__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
__________________________________________________ ______________________

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deployment of a WebApp that uses Word 10.0 via Interop.Word.dll object - How do I register the COM?? Luis Esteban Valencia ASP .Net 2 09-26-2008 08:26 PM
Word file not opening from Adm -My recent docs but opening from file menu of Word Thaqalain Computer Support 0 06-30-2005 02:20 AM
opening a word doc in word not browser Stephen Witter ASP .Net 0 05-18-2004 02:48 AM
Opening MS Word files via Python Fazer Python 5 04-24-2004 08:19 AM
Reading WORD files without opening? Serendipity Computer Support 2 10-19-2003 06:07 PM



Advertisments