Hidden rows with xlrd

1,751 views
Skip to first unread message

Erhard Eiselen

unread,
Aug 7, 2013, 9:38:57 AM8/7/13
to python...@googlegroups.com
Hi all

I have a requirement to process a standard format spreadsheet (i.e. values and labels are always in the same place) with xlrd into a database. The users sometimes hide rows/groups of rows when that sepcifci block of data is not needed, and must therefor not be processed by my Python program.
I have Googled and looked at the xlrd classes, but I cannot figure out how one would determine if a row is hidden or not.
Can anyone please help or point me in the right direction?

Thanks much

John Machin

unread,
Aug 12, 2013, 7:57:40 AM8/12/13
to python...@googlegroups.com


On Wednesday, August 7, 2013 11:38:57 PM UTC+10, Erhard Eiselen wrote:

I have Googled and looked at the xlrd classes, but I cannot figure out how one would determine if a row is hidden or not.


Rowinfo.hidden ??

Erhard Eiselen

unread,
Aug 12, 2013, 8:45:34 AM8/12/13
to python...@googlegroups.com
>>On Wednesday, August 7, 2013 11:38:57 PM UTC+10, Erhard Eiselen wrote:

>>I have Googled and looked at the xlrd classes, but I cannot figure out how
one would determine if a row is hidden or not.

> John Machin wrote:
> Rowinfo.hidden ??

That is what I thought as well, but that was available in V0.6.1
I'm on 0.9.2 and it seems as if it has been dropped - strange.
I checked the libs under dist-packages and it only has a rowinfo_map which
is
not of much use. 
 

John Machin

unread,
Aug 15, 2013, 7:18:48 AM8/15/13
to python...@googlegroups.com, e...@tad.co.za


On Monday, August 12, 2013 10:45:34 PM UTC+10, Erhard Eiselen wrote:
>>On Wednesday, August 7, 2013 11:38:57 PM UTC+10, Erhard Eiselen wrote:

>>I have Googled and looked at the xlrd classes, but I cannot figure out how
one would determine if a row is hidden or not.

> John Machin wrote:
> Rowinfo.hidden ??

That is what I thought as well, but that was available in V0.6.1
I'm on 0.9.2 and it seems as if it has been dropped - strange.

Yeah, really strange.

 
I checked the libs under dist-packages and it only has a rowinfo_map which
is
not of much use. 
 
Not of much use? Try this:

import xlrd
b = xlrd.open_workbook('yourfile.xls', formatting_info=1)
s = b.sheet_by_index(0)
for rowx in range(s.nrows):
    print(rowx)
    s.rowinfo_map[rowx].dump()

Erhard Eiselen

unread,
Aug 15, 2013, 7:48:24 AM8/15/13
to python...@googlegroups.com, e...@tad.co.za

John, you are a genius. Thank you very much. All sorted!

Chris Withers

unread,
Sep 6, 2013, 3:34:49 PM9/6/13
to python...@googlegroups.com, John Machin, e...@tad.co.za
On 15/08/2013 12:18, John Machin wrote:
>
> That is what I thought as well, but that was available in V0.6.1
> I'm on 0.9.2 and it seems as if it has been dropped - strange.
>
> Yeah, really strange.

Sarcy or has this really gone missing?

Should we bring this back or was there a reason it went away?

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk

John Machin

unread,
Sep 9, 2013, 3:41:51 PM9/9/13
to python...@googlegroups.com, John Machin, e...@tad.co.za
AFAICT it never went away.. OP says "it seems as if it has been dropped" with no evidence ....
Reply all
Reply to author
Forward
0 new messages