In python how to extract text from a .ODF file?

A forum for general discussion of the Python programming language.

In python how to extract text from a .ODF file?

Postby vampo650 » Sat Mar 23, 2013 5:49 am

In python how to extract text from a .ODF(Open document format) file?'

Any idea? please let know..Your help is really appreciable..
vampo650
 
Posts: 9
Joined: Wed Mar 20, 2013 6:32 am

Re: In python how to extract text from a .ODF file?

Postby micseydel » Sat Mar 23, 2013 6:19 am

Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 2997
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: In python how to extract text from a .ODF file?

Postby vampo650 » Sat Mar 23, 2013 9:11 am

micseydel wrote:https://pypi.python.org/pypi/odfpy


Hi,

Thanks for your response..I read the document. The author is not mentioned anywhere in the document how to extract the text form a ODF file..
@micseydel, did u work on odfpy earlier ? if yes, can you guide me how to proceed further..Thanks for advance
vampo650
 
Posts: 9
Joined: Wed Mar 20, 2013 6:32 am

Re: In python how to extract text from a .ODF file?

Postby micseydel » Sat Mar 23, 2013 9:35 am

It looks like they might require you to register as a user before giving you access to the documentation. Look around that site, and if you can't find the documentation, bug the developer to get access to it and make it easier for others to find.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 2997
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: In python how to extract text from a .ODF file?

Postby vampo650 » Mon Mar 25, 2013 4:07 am

micseydel wrote:It looks like they might require you to register as a user before giving you access to the documentation. Look around that site, and if you can't find the documentation, bug the developer to get access to it and make it easier for others to find.



Hi again, I registered and I read the documentation. But I didnt find any chapter how to extract the text from ODT file..They had given ODT2HTML, ODT2XML and soon.....
vampo650
 
Posts: 9
Joined: Wed Mar 20, 2013 6:32 am

Re: In python how to extract text from a .ODF file?

Postby bbesase » Thu May 09, 2013 3:35 pm

Code: Select all
import os

path = "path/goes/here"
foundFiles = []
    for r,d,f in os.walk(path):                                                                             #cycles though every file in the the designated path
        for files in f:
            if '.Odf' in files:                                                                        #Only collects files that have "odf" in it

                path = os.path.join(r,files)
                print path



Can't you just use this?
bbesase
 
Posts: 18
Joined: Wed May 08, 2013 1:57 pm

Re: In python how to extract text from a .ODF file?

Postby metulburr » Thu May 09, 2013 6:29 pm

bbesase wrote:
Code: Select all
import os

path = "path/goes/here"
foundFiles = []
    for r,d,f in os.walk(path):                                                                             #cycles though every file in the the designated path
        for files in f:
            if '.Odf' in files:                                                                        #Only collects files that have "odf" in it

                path = os.path.join(r,files)
                print path





Can't you just use this?


in what way does this even extract anything from an ODT file like the OP requested? Not to mention this thread is somewhat old.
we will be moving to python-forum.io on October 1 2016
more details here
User avatar
metulburr
 
Posts: 2231
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Discussions

Who is online

Users browsing this forum: Google [Bot] and 2 guests