'Load from different multiple excel files with different structure into the spreadsheets of an excel files with names using python

I need some help with Azure data factory. I have multiple excel files on blob storage, they have different number of columns and different structure and I need to load all into one excel file, not to one excel sheet, but multiple sheets. I am looking for a way to solve this. Does not matter If I run Python script to do that or some other ways. If somebody knows, would appreciate thank you



Solution 1:[1]

Your question is a little light on details. However, if I understand what you're trying to do correctly, you should be able to copy the worksheets from the source workbooks and merge them into a target workbook using Pandas. It would look something like this:

import pandas as pd

#this targets a single worksheet but you could 
#iterate over a list of sheets in a workbook
df = pd.read_excel(source_workbook, sheet_name="my worksheet")

#push to target workbook
#again this could be in a loop to add each worksheet
df.to_excel(target_workbook, sheet_name="new worksheet")

That is a very simple example but something similar to that should work for merging worksheets into a new workbook.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MrVitaminP