Home > other >  Python screening Excel data
Python screening Excel data

Time:01-05

The from openpyxl import load_workbook, Workbook
The import glob path='F: \ desktop \ \ testing 1'
Wb=Workbook ()
Ws=wb. The active flag=0 for file in glob. Glob (path + '/*. XLS') : wb=load_workbook (file) sheet=wb. Active a=sheet row_lst=[' C '] [] for a cell in a: if a "basic" : in print (cell. Row) row_lst. Append (cell. Row) if not flag: header=sheet [1] header_lst=[] for the cell in the header: header_lst. Append (cell. The value) new_sheet. Append (header_lst) flag=1 for the row in row_lst: data_lst=[] for the cell in sheet/row: data_lst. Append (cell. The value) new_sheet. Append (data_lst) wb. Save (path + '/' + 'eligible for screening new watch. XLSX')
Code does not know where I went wrong, do you have a great god help have a look?

CodePudding user response:

Whether path path forward slash direction is wrong, best to stick out the error message
Prev:STM32
  • Related