我正在使用 python xlrd http://scienceoss.com/read-excel-files-from-python/从 excel 表中读取数据
我的问题是,如果我在 Excel 表中读取第一个单元格为“员工姓名”的行
还有另一行命名,其第一个单元格是“员工姓名”
我们如何从第一个单元格中具有“员工姓名”的最后一行开始读取最后一列。忽略上一个
wb = xlrd.open_workbook(file,encoding_override="cp1252")
wb.sheet_names()
sh = wb.sheet_by_index(0)
num_of_rows = sh.nrows
num_of_cols = sh.ncols
valid_xl_format = 0
invalid_xl_format = 0
if(num_of_rows != 0):
for i in range(num_of_rows):
questions_dict = {}
for j in range(num_of_cols):
xl_data=sh.cell(i,j).value
if ((xl_data == "Employee name")):
# Regardless of how many "Employee name" found in rows first cell,Read only the last "Employee name"