agentsclimarketplace

C 提取cpp文件版本号并导出excel

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/c-提取cpp文件版本号并导出excel

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

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

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.3 KB, 529 tokens by cl100k_base, as published. Nobody here has run it

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文件版本号

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.