Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71830

Re: Reading OpenOffice spreadsheet in Python?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '(at': 0.04; 'output': 0.05; 'subject:Python': 0.06; 'column': 0.07; 'upgraded': 0.07; 'mess': 0.09; 'rows,': 0.09; 'suggestions.': 0.09; 'cc:addr :python-list': 0.11; 'martin': 0.11; 'project,': 0.12; '...,': 0.16; 'finds': 0.16; 'formula': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'inability': 0.16; 'missing?': 0.16; 'rewriting': 0.16; 'spreadsheet.': 0.16; 'subject:Reading': 0.16; 'throw': 0.16; 'xlrd': 0.16; ':-)': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'obviously': 0.18; 'properly': 0.19; 'appears': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'fine': 0.24; "haven't": 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; "i've": 0.25; 'excel': 0.26; 'primary': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'tried': 0.27; 'xml': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'work.': 0.31; '(maybe': 0.31; 'apparently': 0.31; 'cells': 0.31; 'occurs': 0.31; 'option.': 0.31; 'though.': 0.31; 'linux': 0.33; 'worked': 0.33; 'continuing': 0.33; 'mac': 0.33; 'actual': 0.34; 'maybe': 0.34; 'could': 0.34; 'problem': 0.35; 'basic': 0.35; 'problem.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'version': 0.36; 'really': 0.36; 'sequence': 0.36; 'thanks': 0.36; "i'll": 0.36; 'subject:?': 0.36; 'should': 0.36; 'changing': 0.37; 'example,': 0.37; 'sometimes': 0.38; 'writes': 0.38; 'files': 0.38; 'pm,': 0.38; 'though,': 0.39; 'delete': 0.39; 'how': 0.40; 'read': 0.60; 'experts': 0.60; 'first': 0.61; 'such': 0.63; '20,': 0.68; 'reads': 0.68; 'home': 0.69; 'column.': 0.84; 'remarks': 0.84; 'spreadsheet': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=E0Ezu+DJ0Jx5emc6cWexz6Jce2wkAnLl8BJI6Ir1C2M=; b=a96DrG1g4eLyQ7eVBO+72gAEN2dwxUz72ggaCOb03etgZl7ETK8tTW1utb6f9FRrnl acHjP4pUF+oR/K6ZKyTjnMpLaMJuxFQO1HSZurmmwU8RlZxtRoktwnL1w/nNEEr681VV iqTwviuxqmkvpdVemQxH0nBql+qDLypR5gZIB94KsGS3hFVq0uxvlhJ/gRzYQE2AVI1Z 7sEzZ2PO7eytaNB7hExLrgG90t3TNr5vzC6t2elmX72aSEYqcXJigZDYMPkMIUA2uyOs VMLv/s7GXd8DiyWE/Ja+zfZd5DdrtRHhzRqsdUQqZhxQ1/9F/MqpzecZBVNEQ6gqwcp7 dY2A==
MIME-Version 1.0
X-Received by 10.50.122.67 with SMTP id lq3mr9006314igb.8.1400623697895; Tue, 20 May 2014 15:08:17 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <20140520214515.1089e2c7@Fuddel>
References <mailman.10158.1400603888.18130.python-list@python.org> <20140520214515.1089e2c7@Fuddel>
Date Tue, 20 May 2014 17:08:17 -0500
X-Google-Sender-Auth u2lUDlEO6gRr7nO4boi--48JDsI
Subject Re: Reading OpenOffice spreadsheet in Python?
From Skip Montanaro <skip@pobox.com>
To Martin Manns <mmanns@gmx.net>
Content-Type text/plain; charset=UTF-8
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10173.1400623700.18130.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400623700 news.xs4all.nl 2906 [2001:888:2000:d::a6]:41977
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71830

Show key headers only | View raw


On Tue, May 20, 2014 at 2:45 PM, Martin Manns <mmanns@gmx.net> wrote:
>> I am so fed up with LibreOffice's inability to properly support really
>> basic Excel capabilities, I'm about ready to throw my computer out the
>
> Could you please give some examples, what basic Excel capabilities you
> are missing?

That's the problem. It's not that it's obviously missing some
features. It's that the files it writes sometimes are misinterpreted
by xlrd. (Maybe the problem is xlrd, but it never has a problem with
actual Excel-generated XLS files.)

For example, I use a formula to generate a sequence of strings in one column:

    "F0", "G0", "H0", ..., "Z0", "F1", "G1", ...

continuing for as long as I have data in an adjoining column. If I add
or delete rows, this sequence grows and shrinks. It looks fine in the
spreadsheet. I rarely, if ever, change the number of rows, so the
values in this column rarely, if ever, change. Still, sometimes when
xlrd reads the values out of that column it finds all cells in that
column contain the number 0. If I mess around with the spreadsheet in
ways which are apparently unrelated to this column, I can sometimes
get it to read right, sort of like hitting a jukebox to stop a record
from skipping.

I haven't tried changing the output format to XLSX format (isn't that
a compressed XML document?), but maybe I should give that a whirl. I
don't know if xlrd will read such files (at first blush, it appears
not).

Also, Mac isn't my primary platform. This problem occurs using the
Linux version of LibreOffice as well. Sometimes I edit this
spreadsheet from home though. Before I upgraded to OS X Mavericks, I
still had an ancient version of Excel for Mac which worked fine
(despite all the disparaging remarks I've seen over the years about
that product). Once I upgraded though, that was no longer an option.

Thanks for the gnumeric and pyspread suggestions. I thought gnumeric
was a long dead project, but see that it's available for my Mac, so
I'll try that right off. I'll also play around with pyspread and see
how that does. I don't mind rewriting my couple of formulas, though I
will no longer be able to rely on the Excel experts at work. :-)

Skip

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Reading OpenOffice spreadsheet in Python? Skip Montanaro <skip@pobox.com> - 2014-05-20 11:38 -0500
  Re: Reading OpenOffice spreadsheet in Python? Martin Manns <mmanns@gmx.net> - 2014-05-20 21:45 +0200
    Re: Reading OpenOffice spreadsheet in Python? Skip Montanaro <skip@pobox.com> - 2014-05-20 17:08 -0500
  Re: Reading OpenOffice spreadsheet in Python? Rustom Mody <rustompmody@gmail.com> - 2014-05-20 18:19 -0700
    Re: Reading OpenOffice spreadsheet in Python? Skip Montanaro <skip@pobox.com> - 2014-05-20 20:33 -0500
  Re: Reading OpenOffice spreadsheet in Python? Rustom Mody <rustompmody@gmail.com> - 2014-05-21 01:53 -0700
    Re: Reading OpenOffice spreadsheet in Python? Skip Montanaro <skip@pobox.com> - 2014-05-21 09:24 -0500

csiph-web