From: John Machin <sjmac...@lexicon.net>
Date: Fri, 19 Jun 2009 18:25:00 +1000
Subject: Re: [pyxl] Re: Script to convert from XLSX to XLS
On 19/06/2009 10:45 AM, vasudevram wrote:
> On Jun 15, 9:29 pm, Michael <selmo2...@gmail.com> wrote: > Interesting approach. > For a possibly limited but cross-platform way (i.e. don't need to be > (*) Conditions apply - see below. > This alternative method is possible because .XLSX format files are a ZIP file containing a bundle of XML documents. The Python Cookbook 2nd Edition was published in 2005. The recipe (12.7) to which you refer relates to the XML files that can be produced by Excel 2003 (v11) and Excel XP (v10), using the "XML Spreadsheet" option of "Save as". The two formats are XMLly and Microsofty but otherwise rather dissimilar. > I had tried out that recipe some time Any parser within reason can be used, not just SAX. We have an XLSX > ago (it worked fine, though I had to tweak it a bit), and used it to > convert the (text-only) content of .XLSX files to PDF, as part of my > xtopdf toolkit. That code is not in the xtopdf release yet, but will > be after some time. If I can dig up the (standalone) code I wrote for > that conversion, I'll post a link to it here in a few days. But > basically, it's really easy to read .XLSX content with Python using > SAX, since there are clearly defined XML elements for tables, rows and > cells. In fact, that means you can also read the .XLSX content using > any language that has a SAX XML parser, not just Python. parser (using ElementTree) in the queue to be plugged into xlrd. It handles the basics i.e. open_workbook(..., formatting_info=0). You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||