读取特定单元格的Excel数据

时间:2015-12-01 12:42:16

标签: python-3.x xlrd

Overall Status                      
Number of Servers  Start time       End Time
                   1/12/2015 5:34AM 2/12/2015 07:30AM
Component1 Component2 Priority  Status      
1          5              Priority1         In Progress 

对于excel表中的上述数据,我使用此代码从excel中为所有列提取数据,但它没有给出任何输出 - :

for i in range(sheet.nrows): row = sheet.row_values(i) for j in range(len(row)): if str(row[j]).strip()=="Revised/Estimated Completion Date Time": i+=2 print(sheet.cell_value(i,j)) if str(row[j]).strip()=="Planned Completion Date Time": i+=2 print(sheet.cell_value(i,j)) break

0 个答案:

没有答案