现在有两套结构一致的数据,放在80和2000两个文件夹中,文件名字相同,但文件数据不一致
80中的是xls格式存储,利用xlrd读取数据
2000中的是xlsx格式存储,利用openpyxl读取数据
然后对读取到的数据进行对比
第一种对比过后,将相应的子项内容罗列出来:
def compareData(fileName):
file80 = get_filename_from_dir('F:\\80')
resultfx = []
if fileName in file80:
wb80 = xlrd.open_workbook('80/'+fileName)
wb2000 = xlrd.open_workbook('2000/'+fileName)
sheet80_0 = wb80.sheet_by_index(0)
sheet80_1 = wb80.sheet_by_index(1)
sheet2000_0 = wb2000.sheet_by_index(0)
sheet2000_1 = wb2000.sheet_by_index(1)
test = sheet80_0.cell(0,1).value
test2 = sheet2000_0.cell(5,0).value
#表2
#print test,"+++++",test2
for i in range(3,8):
for j in range(1,13):
if(cmp(j,10)!=