4
I’m having trouble reading the information from a spreadsheet that has rows and columns merged. I tried to use merged_cell to get the value, but I don’t understand how it works. Can anyone help me?
Using the script below, I can get the values, except for for merged cells. How can I get all cells, including merged cells?
from xlrd import open_workbook,cellname
workbook = open_workbook('file.xls')
sheet = workbook.sheet_by_index(0)
for row_index in range(sheet.nrows):
for col_index in range(sheet.ncols):
print cellname(row_index,col_index),'-',
print sheet.cell_value(row_index,col_index)
Your problem is that the merged cells give no value, or that only one of them (top-left) gives some value?
– mgibsonbr
Hi, I have a table 515x258. I have for example five columns merged, and within merge I have 2 rows. The first row is normal and the second row has 4 columns merged. Can you visualize mentally? Of all these rows and columns, I get value from: some cells that are merged and I get no unmixed cell value. All cells contain values.
– Mary Tortugo