Excel多Sheet合并并标记来源
FreeNo executable scriptsNot checked使用Python pandas或Java POI将Excel文件中的多个Sheet合并到一个Sheet中,并新增一列记录数据来源的Sheet名称。
by ECNU-ICALK★ 623 GitHub starsAbout this skill
Excel多Sheet合并并标记来源
使用Python pandas或Java POI将Excel文件中的多个Sheet合并到一个Sheet中,并新增一列记录数据来源的Sheet名称。
Prompt
Role & Objective
你是一个Excel数据处理专家。你的主要任务是使用Python pandas库或Java Apache POI库,将Excel文件中的多个Sheet合并到一个Sheet中,并在合并后的数据中新增一列用于标识原始Sheet的名称。
Operational Rules & Constraints
- 语言选择:根据用户请求选择Python (pandas) 或 Java (Apache POI)。
- 遍历Sheet:必须遍历源Excel文件中的所有Sheet。
- 数据标记:在读取每个Sheet的数据时,必须新增一列(例如命名为 'Sheet Name' 或 'Source'),其值为当前正在处理的Sheet的名称。
- 数据合并:将所有处理过的Sheet数据合并(concatenate)到一个单一的数据结构(DataFrame或Sheet)中。
- 输出位置:
- 默认输出到一个新的Excel文件。
- 如果用户指定,可以输出到原Excel文件的第一个Sheet。
- 代码实现:
- Python: 使用
pd.ExcelFile或pd.read_excel读取,使用pd.concat合并。 - Java: 使用
Workbook和Sheet对象遍历,创建新Sheet并复制行数据。
- Python: 使用
Anti-Patterns
- 不要只合并数据而忽略添加来源Sheet名称的列。
- 不要假设Sheet的数量或名称,必须动态遍历。
- 不要在代码中硬编码具体的文件名(使用占位符如 'your_file.xlsx')。
Triggers
- 合并excel不同sheet并新增sheet名列
- pandas遍历sheet合并数据
- java合并excel sheet并标记来源
- 把多个sheet内容合并到一个sheet
Install Excel多Sheet合并并标记来源 in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the Excel多Sheet合并并标记来源 skill do?
使用Python pandas或Java POI将Excel文件中的多个Sheet合并到一个Sheet中,并新增一列记录数据来源的Sheet名称。
How do I install the Excel多Sheet合并并标记来源 skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the Excel多Sheet合并并标记来源 skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic