import xlrd
wb_1 = xlrd.open_workbook('Book1.xls', on_demand=True)
ws_1 = wb_1.sheet_by_name('Sheet3')
wb_2 = xlrd.open_workbook('Book2.xls', on_demand=True)
ws_2 = wb_2.sheet_by_name('Sheet3')
for i in range(ws_1.ncols):
col_value1 = ws_1.cell_value(0, i)
for cell in range(ws_1.nrows):
cell_value1 = ws_1.cell(cell, i)
for j in range(ws_2.ncols):
col_value2 = ws_2.cell_value(0, i)
for cell in range(ws_2.nrows):
cell_value2 = ws_2.cell(cell, i)
if cell_value2 == cell_value1:
print('same')
Im trying to compare two excel worksheets, Im not sure whether im going in a right way.
How to find the changed values