The .xlsx
files are all found in one directory. There is only .xlsx
file in this directory. I need to take each of the individual .xlsx
files and insert it into a single sheet.
The example looks like this:
- Directory has 4
.xlsx
files - Read all 4
.xlsx
files - Put all 4
.xlsx
files into one single file - Each file should represent one sheet.
The final result should be one Excel file with 4 sheets.
The process for doing this is:
0. Setup
Install required packages:
Then import pandas into the Python file you're working in:
1. Read in the
.xlsx
filesa. Each by name:
etc
b. Read all in current directory in:
2. Create a new file and add existing files as sheets
This will create a new Excel file in the current directory called
newfilename.xlsx
with each of your existing Excel files as sheets.