I would like to merge 2 tables from two different Excel files. I'd like to add a column in the new table to indicate the name of the excel file in question.
The aim would be to merge a multitude of tables with a column indicating the name of the file.
file_path = "C:\excel files" myfile = os.listdir(file_path) for f in myfile: with open(f) as infile: contents = infile.read() print(contents)
you can use
pandas, can you try the following: