Home > other >  Extract F H column and column, the specified someone's integral, strives for the code!
Extract F H column and column, the specified someone's integral, strives for the code!

Time:09-18



Extract F H column and column, the specified someone's integral, strives for the code!

CodePudding user response:




 

The from openpyxl import load_workbook

Check_name=[' li ', 'zhao zilong]
Xls_file='x1. XLSX'
Wb=load_workbook (xls_file)
Print (wb. Sheetnames)
Ws=wb/' Sheet2 '
For I in range (1, ws. Max_row + 1) :
# print (ws [' F {} '. The format (I)], value)
If the ws [' F {} '. The format (I)]. The value in check_name:
Print (I, ws [' F {} '. The format (I)]. The value, the ws [' H {} '. The format (I)], value)

CodePudding user response:

If is just a work, simple to use openpyxl traverse a can, if it is repetitive work, and the data quantity is big, can consider to use pandas
  • Related