Can use either of these not just pandas import csv pandas openpyxl import load_workbook openpyxl.utils import get_column_letter xlrd glob
Want to combine multiple excel files: I have tried this simpleapproach->
# collect excel content into list of dataframes
data = []
for excel_file in excel_files:
data.append(pd.read_excel(excel_file, engine="openpyxl"))
data.append(gapDf)
# concatenate dataframes horizontally
df = pd.concat(data, axis=1)
# save combined data to excel
df.to_excel(excelAutoNamed, index=False)
Problem Above approach messes with the formatting of how the excel file initially was because it just adds everything to a dataframe list and appends it** which gets rid of column highlights ,bolding
Instead of converting them to df then concating, how to add multiple excel files to one workbook
Idea keep track of the previous excel files last column b/c to leave some gap to write the next excel file on the workBook. (quickNote: trying a dynamic approach bc not all excel files have the same # of columns)