for i in range(len(tables)):
tb = tables[i]
# 获取表格的行
tb_rows = tb.rows
# 读取每一行内容
ws = wb.create_sheet("test"+str(i))
for j in range(len(tb_rows)):
row_data = []
row_cells = tb_rows[j].cells
# 读取每一行单元格内容
k = 1
for cell in row_cells:
row_data.append(cell.text) # 单元格内容
# 设定t为当前行
t = j
# c为当前行、当前列的表格的内容
c = cell.text
# 判断当前格内容是否为空,若当前表格为空,则t-1取上一行的该列的值
wh
2024-05-09 11:53:35
2KB
python
1