Combine Excel Files Into One Workbook
Generate a Python script that combines Excel files from one folder into a single file, adds a column identifying each source file, and explains how a beginner can run the script
Prompt template
- Format
- Text Parameterized
- Inputs
- Folder_location (text) · Required Shared_columns (text) · Required folder_path (text) · Required
- Outputs
- Python_script_and_run_instructions (code, text)
Write a Python script that combines all Excel files in one folder into a single file.
Folder location: ${folder-path}
Shared columns: ${shared-columns}
Add a column containing the name of the source file for each row. Explain step by step how a beginner can run the script from scratch.
Replace the ${…} placeholders with your values
before using this prompt. See parameters
and defaults below
Parameters
Replace each placeholder with your own value, or use its default when one is provided
${folder-path}
folder-path
Required
${shared-columns}
shared-columns
Required
What you'll create
This prompt asks for a Python script that combines Excel files from one folder into a single file and adds a column with each row’s source filename. It also requests step-by-step instructions for running the script from scratch
Usage instructions
Frequently asked questions
What column information should I provide?
List the columns the files have in common so the script can account for their shared structure
Comments
Tried this prompt? Share what you made, compare results, or ask a question