extracting data from ODF files
Hi, is there a (simple) solution to extract data from OpenDocument files (espacially OpenOffice.org Calc files) into a Numpy Array? At the moment I copy the colums from OO.org Calc manually into a tab-separatet Plaintext file which is quite annoying. Regards, Manuel Wittchen
Hi Manuel, you may save your odf file as a csv (comma separated value) file with OpenOffice, then use np.loadtxt, specifying the 'delimiter' keyword: myarray = np.loadtxt('myfile.csv', delimiter=',') Cheers, Emmanuelle On Tue, Jan 05, 2010 at 10:14:54PM +0100, Manuel Wittchen wrote:
Hi,
is there a (simple) solution to extract data from OpenDocument files (espacially OpenOffice.org Calc files) into a Numpy Array? At the moment I copy the colums from OO.org Calc manually into a tab-separatet Plaintext file which is quite annoying.
Regards, Manuel Wittchen _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
There is a possibility to export the data to excel format and use xlrd or similar package to read it. Nadav -----Original Message----- From: numpy-discussion-bounces@scipy.org on behalf of Manuel Wittchen Sent: Tue 05-Jan-10 23:14 To: Discussion of Numerical Python Subject: [Numpy-discussion] extracting data from ODF files Hi, is there a (simple) solution to extract data from OpenDocument files (espacially OpenOffice.org Calc files) into a Numpy Array? At the moment I copy the colums from OO.org Calc manually into a tab-separatet Plaintext file which is quite annoying. Regards, Manuel Wittchen _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Nadav Horesh wrote:
is there a (simple) solution to extract data from OpenDocument files (espacially OpenOffice.org Calc files) into a Numpy Array?
Aren't they XML? you may be able to use an XML parser. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
Le mardi 05 janvier 2010 à 22:34 -0800, Christopher Barker a écrit :
Nadav Horesh wrote:
is there a (simple) solution to extract data from OpenDocument files (espacially OpenOffice.org Calc files) into a Numpy Array?
Aren't they XML? you may be able to use an XML parser.
See, e.g., http://wiki.services.openoffice.org/wiki/CalcParser Maybe another solution is to use the python open office interface : python-uno ? -- Fabrice Silva Laboratory of Mechanics and Acoustics (CNRS, UPR 7051)
participants (5)
-
Christopher Barker
-
Emmanuelle Gouillart
-
Fabricio Silva
-
Manuel Wittchen
-
Nadav Horesh