Jul-29-2020, 01:41 PM
Hello,
For some reason this isn't working, it shows files list as 0 []. I have 6 .xlsx files in the input_dir. If I put the .xlsx file where the script is it will work, but I need these .xlsx files in their own folder not with the script.
For some reason this isn't working, it shows files list as 0 []. I have 6 .xlsx files in the input_dir. If I put the .xlsx file where the script is it will work, but I need these .xlsx files in their own folder not with the script.
import openpyxl as xl import os import pandas as pd import xlsxwriter input_dir = 'C:\\Users\\\work\\comparison' files = [file for file in os.listdir(input_dir) if os.path.isfile(file) and file.endswith(".xlsx")] for file in files: input_file = os.path.join(input_dir, file) wb1=xl.load_workbook(input_file) ws1=wb1.worksheets[0]