willtrnr / pyxlsb

Excel 2007+ Binary Workbook (xlsb) reader for Python
GNU Lesser General Public License v3.0
90 stars 21 forks source link

Unable to get data when the first column is empty #3

Closed Paliking closed 6 years ago

Paliking commented 6 years ago

Hi, thanks for the library. It works well when the first column is not empty.

INPUT

wb = pyxlsb.open_workbook(xlsb_file)
sheet = wb.get_sheet(sheet_name)
print(sheet.dimension)
for row in sheet.rows():
    do something

OUTPUT

dimension(r=0, c=1, h=3, w=2)
File "...packages\pyxlsb\worksheet.py", line 71, in rows
    row[item[1].c] = Cell._make([row_num, item[1].c, item[1].v])
IndexError: list assignment index out of range

I'm using 64-bit python 3 on Windows 10. pyxlsb v1.0.2 Do you have the same issue? Thank you

willtrnr commented 6 years ago

Oh that's interesting, it seems I never had a case with an empty first column.

With those dimension numbers I assume you have columns B and C filled, right?

willtrnr commented 6 years ago

Fixed in 1.0.3

Paliking commented 6 years ago

yes, exactly. thx for your fast fix.