已知一个Excel表文件,在其中一个Sheet里有一列汇总数据,查这些数据在目标文件夹各Excel文件的出现情况。
import xlrd
import xlwt
import xlutils
import random
import copy
import pathlib
import os
def getusefile(orgxls='.'):
usefile=[]
excelfile=sorted(pathlib.Path(orgxls).glob('**/*.xls*'))
usefile=[str(tpfile) for tpfile in excelfile]
return copy.deepcopy(usefile)
def rdusefile(fileName):
data=xlrd.open_workbook(fileName)
worksheets = data.sheet_names()
findout=[]
for filenum in range(len(worksheets)):
sheet_1=data.sheets()[filenum]
nrows=sheet_1.nrows
ncols=sheet_1