我能使用xlrd通过列和行号读取Excel单元格的值。现在我需要访问一些以.ods格式保存的电子表格中相同的单元格值。
例如,我该如何用Python读取存储在.ods文件中E10单元格中的值?
我能使用xlrd通过列和行号读取Excel单元格的值。现在我需要访问一些以.ods格式保存的电子表格中相同的单元格值。
例如,我该如何用Python读取存储在.ods文件中E10单元格中的值?
address="E10"
或 column="E"
这样的单元格属性; 需要计算行和列。<table:table-cell table:number-columns-repeated="5" />
number-colums-repeated
属性默认为 "1",也适用于非空单元格。table-cell
标记90%相同的 covered-table-cell
标记,并且需要将 number-columns-spanned
和 number-rows-spanned
属性计入列和行计数。
table:table-row
标记可能具有 number-rows-repeated
属性。这可用于重复整个非空行的内容,但最常见的是在有超过1个连续空行时使用。xlrd
中... 但这不会很快发生。from ezodf import opendoc, Sheet
doc = opendoc('test.ods')
for sheet in doc.sheets:
print sheet.name
cell = sheet['E10']
print cell.value
print cell.value_type
pyexcel-ods 崩溃, odfpy 崩溃,此外其文档要么缺失要么糟糕。