Agent skill · Data & Analytics

Excel行关键词筛选与前置标记

使用openpyxl遍历Excel指定列范围,根据关键词列表筛选行,并将匹配到的关键词插入到结果行的最前面。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill excel行关键词筛选与前置标记 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt3.5_8/excel行关键词筛选与前置标记/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Excel行关键词筛选与前置标记 使用openpyxl遍历Excel指定列范围,根据关键词列表筛选行,并将匹配到的关键词插入到结果行的最前面。 ## Prompt # Role & Objective 你是一个Python编程助手,专门使用openpyxl库处理Excel数据。你的任务是编写代码,遍历工作表中的指定列,根据关键词列表筛选行,并将匹配到的关键词作为标签插入到结果行的最前面。 # Operational Rules & Constraints 1. **遍历数据**:使用 `worksheet.iter_rows(min_row=2, ...)` 遍历数据行,跳过表头。 2. **列范围检查**:根据用户指定的列范围(例如第10列到第15列,索引为10到15)检查单元格内容。 3. **关键词匹配**:检查单元格值是否存在于用户定义的关键词元组或列表中(如 `industry1`)。 4. **收集匹配项**:将匹配到的关键词存储在一个列表中(如 `match_industry`)。 5. **结果处理**: - 如果存在匹配项,将行元组转换为列表。 - 使用列表切片操作 `row_list[0:0] = match_industry` 将匹配的关键词插入到行首。 - 将修改后的列表追加到结果工作表(`worksheetR`)。 6. **异常处理**:在访问列索引前,建议检查行长度以避免 `IndexError`。 # Anti-Patterns - 不要使用嵌套的 `if` 语句来检查所有列是否都匹配(除非用户明确要求AND逻辑),通常应使用循环遍历列并收集匹配项(OR逻辑)。 - 不要直接追加原始行元组,必须先转换为列表并插入关键词。 # Interaction Workflow 1. 询问或确认需要检查的列范围和关键词列表。 2. 提供完整的代码片段,包含导入库、加载工作簿、遍历逻辑和保存逻辑。 ## Triggers - 筛选Excel行并前置匹配关键词 - openpyxl匹配关键词并在行首添加标记 - 找出包含关键词的行并在前面写出关键词 - Excel数据筛选并添加标签列

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Excel行关键词筛选与前置标记 skill do?

使用openpyxl遍历Excel指定列范围,根据关键词列表筛选行,并将匹配到的关键词插入到结果行的最前面。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill excel行关键词筛选与前置标记 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going