Find a way to process excel esaily,base on openpyxl,xlrd,xlwt.support .xls.xlsx
pip3 install xlprocess
- tolist.tolist(filename='', sheetnum=-1)
sheetnum=-1 meaning all sheets in file change to list.The data structure like this:
[[sheetname,[value in A1,value in A2,value in A3],[value in B1,value in B2,value in B3], ......value in N3],[sheetname2,[...]]
-
formatchange.tocsv(filename,sheetnum=-1)
-
-1 mean include every sheet.
-
formatchange.toxlsx(filename,sheetnum=-1)
-
-1 mean include every sheet.
- fileprocess.combination(xlsx=True,file1,file2,file3...)
If all file in same folder,you can use:
- fileprocess.fcombination(xlsx=Ture,dir='yourdir')
Default return a new file named 'comfile.xlsx',but when the character in cell is too long openpylx might throw IllegalCharacterError exception.In this condition,you can change xlsx parameter to False.But in this case,you should make sure every sheet's name is different.
- fileprocess.filesplit(xlsx=True,'filename')
- sheeetprocess.rowtltie(xlsx=True,'filename',sheetnum=-1,title=1)
-
sheetprocess.groupby(xlsx=True,filename,sheetnum=-1,*col)
-
Last of *col meaning quantity.For example,groupby(True,'data/test1.xls',0,1,2,3),meaning accounting the third column
- sheetprocess.classify(xlsx=True,'filename',*col)
The MIT License