0

I want to combine several xlsx files into one. However this xlsx files have different number of lines and they have highlight cells. When I combine them into one, they appear to be next, without a row beteween the two dataframes, and they also lost the highlighted cells.

Here is the code I have, so far:

writer=pd.ExcelWriter('output.xlsx')
# xlsfiles = [files_in for files_in in glob.glob('*.xlsx')]
for files_in in glob.glob('*.final_2.xlsx'):
    excel_file=pd.ExcelFile(files_in)
    df_excell=pd.read_excel(files_in)
    df_excell.to_excel(writer,index=False)
writer.save()

Thanks!

Mehdi
  • 717
  • 1
  • 7
  • 21
Sofia
  • 365
  • 3
  • 17

1 Answers1

0

I would start by taking a look at a similar question a user has posted here:

Python Excel template read and re-write, maintaining formulae and formatting

Jeff Coldplume
  • 343
  • 1
  • 13