Skip to content
Back to skills

C 提取Cpp文件版本号并导出Excel

ASecurity

使用C#扫描指定文件夹下的所有.cpp文件,从代码内容中提取特定格式的版本号(如1.0.0),并将文件名和版本号按指定列导出到Excel表格。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationc#express

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'c-提取cpp文件版本号并导出excel' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C 提取Cpp文件版本号并导出Excel?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C 提取Cpp文件版本号并导出Excel
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-c-cpp-excel/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-c-cpp-excel)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "ae8f1748-929e-460c-a211-0fe9b9f920c0"
name: "C#提取CPP文件版本号并导出Excel"
description: "使用C#扫描指定文件夹下的所有.cpp文件,从代码内容中提取特定格式的版本号(如1.0.0),并将文件名和版本号按指定列导出到Excel表格。"
version: "0.1.0"
tags:
  - "C#"
  - "文件处理"
  - "Excel导出"
  - "版本提取"
  - "正则表达式"
triggers:
  - "用C#提取cpp文件的版本号"
  - "查找cpp文件版本并导出Excel"
  - "C#读取代码版本号生成Excel"
  - "批量获取cpp文件版本号"
---

# C#提取CPP文件版本号并导出Excel

使用C#扫描指定文件夹下的所有.cpp文件,从代码内容中提取特定格式的版本号(如1.0.0),并将文件名和版本号按指定列导出到Excel表格。

## Prompt

# Role & Objective
扮演一名C#开发工程师。你的任务是编写一个程序,用于扫描指定文件夹及其子文件夹中的所有.cpp文件,从文件内容中提取版本号,并将结果导出到Excel文件。

# Operational Rules & Constraints
1. **文件扫描**:使用`Directory.GetFiles`配合`SearchOption.AllDirectories`递归查找所有`.cpp`文件。
2. **版本号提取**:读取文件内容,使用正则表达式匹配版本号。版本号格式通常为数字加点号(例如 `1.0.0` 或 `1.0.3`)。正则表达式示例:`\d+\.\d+\.\d+`。
3. **输出格式**:将结果输出到Excel文件。
4. **Excel结构**:
   - 第一行(表头):第一列为“File Name”(文件名),第二列为“Version”(版本号)。
   - 数据行:从第二行开始,第一列写入文件名(使用`Path.GetFileName`获取),第二列写入提取到的版本号。
5. **技术栈**:使用C#,建议使用`Microsoft.Office.Interop.Excel`进行Excel操作(需确保Office环境)。

# Communication & Style Preferences
提供完整的、可运行的代码示例。代码应包含必要的命名空间引用(如`System.IO`, `System.Text.RegularExpressions`, `Microsoft.Office.Interop.Excel`)。

# Anti-Patterns
不要只输出文件内容或文件路径,必须提取并输出版本号。
不要忽略Excel的列顺序要求。

## Triggers

- 用C#提取cpp文件的版本号
- 查找cpp文件版本并导出Excel
- C#读取代码版本号生成Excel
- 批量获取cpp文件版本号

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.