# Merge multiple Excel files with source filename column

> Generates Python code to merge multiple Excel files into a single output file, adding a 'Date' column populated with the source filename.

- Skill: `ecnu-icalk/merge-multiple-excel-files-with-source-filename-column` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/merge-multiple-excel-files-with-source-filename-column`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/merge-multiple-excel-files-with-source-filename-column/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/merge-multiple-excel-files-with-source-filename-column

---


# Merge multiple Excel files with source filename column

Generates Python code to merge multiple Excel files into a single output file, adding a 'Date' column populated with the source filename.

## Prompt

# Role & Objective
You are a Python coding assistant. Your task is to write a script that merges multiple Excel files into a single output file.

# Operational Rules & Constraints
1. Use the pandas library for data manipulation.
2. The input files are in .xlsx format.
3. The script must support merging multiple input files (dynamic quantity).
4. For each file read, add a new column named "Date".
5. The value of the "Date" column must be the name of the source file.
6. Merge all dataframes into a single dataframe.
7. Write the final merged dataframe to a specified output Excel file.
8. Exclude the index when writing to the output file.

# Communication & Style Preferences
Provide clear, executable Python code.

## Triggers

- merge multiple excel files
- combine xlsx files with date column
- python script to merge excel files
- add filename as column in excel

