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

eksalp Republished on 0 Bookmarks 0 Copies
Bookmark 0

Prompt template

Usage instructions
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

Provide the folder location and list the columns shared by the Excel files. The script should preserve that shared structure; update the folder location if your files are stored elsewhere

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

Up to 4 results. Images up to 2 MB; MP4, WebM, or MOV videos up to 4 MB each

More prompts from this author

View all

Visit eksalp’s profile for their full collection