Install any skill in seconds. Free to start, no credit card required.
Get Started Free →统计多Sheet Excel总行数并根据规模选择处理策略,提取特定维度信息进行去重统计,并生成摘要与明细报表。
.claude/skills/opensensenova-excel-multi-sheet-threshold-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 7% | 0% |
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 加载目标数据表,并进行初步的数据预览与结构检查。
pythonimport pandas as pd file_path = 'input_file.xlsx' target_sheet = 'Sheet1' # 根据实际情况指定 sheet 名称 # 读取数据,header=None 用于处理无表头或非标准表头文件 df = pd.read_excel(file_path, sheet_name=target_sheet, header=None) print(f"数据形状: {df.shape}") print("前 5 行预览:") print(df.head())
Step2 遍历数据行,基于关键词提取目标信息,并执行数据清洗(去除空格、空值过滤)。
pythonimport pandas as pd # 设定目标列索引及过滤关键词 target_col_idx = 1 keywords = ["关键词A", "关键词B"] # 示例:如"综合楼"、"控制中心" extracted_data = [] for idx, row in df.iterrows(): cell_val = str(row[target_col_idx]) if pd.notna(row[target_col_idx]) else "" # 数据清洗:去除首尾空格并匹配关键词 clean_val = cell_val.strip() if any(k in clean_val for k in keywords): if clean_val and clean_val.lower() not in ["nan", "null", ""]: extracted_data.append(clean_val) print(f"提取到相关记录共 {len(extracted_data)} 条")
Step3 对提取的信息进行分类去重,统计各维度的唯一项数量。
python# 使用 set 进行高效去重 category_a_items = set() category_b_items = set() for item in extracted_data: if "关键词A" in item: category_a_items.add(item) elif "关键词B" in item: category_b_items.add(item) # 转换为排序后的列表 list_a = sorted(list(category_a_items)) list_b = sorted(list(category_b_items)) print(f"类别A 唯一项数量: {len(list_a)}") print(f"类别B 唯一项数量: {len(list_b)}")
Step4 将统计摘要与详细清单整理为 DataFrame,并导出为 Excel 文件提供下载。
pythonimport pandas as pd # 1. 生成统计摘要 summary_df = pd.DataFrame({ '分类名称': ['类别A', '类别B'], '唯一项总数': [len(list_a), len(list_b)] }) # 2. 生成详细清单 detail_list = [] for val in list_a: detail_list.append({'分类': '类别A', '详细名称': val}) for val in list_b: detail_list.append({'分类': '类别B', '详细名称': val}) detail_df = pd.DataFrame(detail_list) # 导出结果 output_summary_path = 'summary_report.xlsx' output_detail_path = 'detail_list.xlsx' summary_df.to_excel(output_summary_path, index=False) detail_df.to_excel(output_detail_path, index=False) print(f"统计摘要已保存: {output_summary_path}") print(f"详细清单已保存: {output_detail_path}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-06 | fail→pass | 10,543 | 7,150 | -32% | 1 | 1 | 0% | 1,510 | 1,882 | +25% | 0 | 0 | — |
case-01 | fail→fail | 16,403 | 13,343 | -19% | 1 | 1 | 0% | 3,179 | 3,050 | -4% | 0 | 0 | — |
case-02 | fail→pass | 13,342 | 10,078 | -24% | 1 | 1 | 0% | 2,791 | 2,535 | -9% | 0 | 0 | — |
case-03 | fail→pass | 14,397 | 8,501 | -41% | 1 | 1 | 0% | 3,036 | 2,658 | -12% | 0 | 0 | — |
case-04 | fail→pass | 11,514 | 7,287 | -37% | 1 | 1 | 0% | 1,805 | 2,148 | +19% | 0 | 0 | — |
case-05 | fail→pass | 17,356 | 8,944 | -48% | 1 | 1 | 0% | 2,307 | 2,472 | +7% | 0 | 0 | — |
case-07 | fail→pass | 8,914 | 3,609 | -60% | 1 | 1 | 0% | 1,645 | 1,516 | -8% | 0 | 0 | — |
case-08 | pass→pass | 13,382 | 6,382 | -52% | 1 | 1 | 0% | 2,467 | 1,995 | -19% | 0 | 0 | — |
case-09 | fail→pass | 13,366 | 5,031 | -62% | 1 | 1 | 0% | 2,463 | 1,775 | -28% | 0 | 0 | — |
case-10 | fail→pass | 11,459 | 4,394 | -62% | 1 | 1 | 0% | 1,676 | 1,637 | -2% | 0 | 0 | — |
case-11 | pass→pass | 20,908 | 7,053 | -66% | 1 | 1 | 0% | 1,892 | 2,040 | +8% | 0 | 0 | — |
case-12 | fail→pass | 9,740 | 5,531 | -43% | 1 | 1 | 0% | 1,660 | 1,750 | +5% | 0 | 0 | — |
case-13 | pass→pass | 6,457 | 3,447 | -47% | 1 | 1 | 0% | 1,296 | 1,248 | -4% | 0 | 0 | — |
case-14 | pass→pass | 3,005 | 2,960 | -1% | 1 | 1 | 0% | 425 | 1,280 | +201% | 0 | 0 | — |
case-15 | pass→pass | 10,674 | 11,410 | +7% | 1 | 1 | 0% | 1,933 | 2,645 | +37% | 0 | 0 | — |
case-16 | fail→fail | 12,269 | 9,261 | -25% | 1 | 1 | 0% | 1,899 | 2,721 | +43% | 0 | 0 | — |
case-17 | fail→fail | 12,399 | 10,039 | -19% | 1 | 1 | 0% | 2,097 | 2,471 | +18% | 0 | 0 | — |
case-18 | pass→pass | 6,826 | 6,124 | -10% | 1 | 1 | 0% | 1,207 | 1,583 | +31% | 0 | 0 | — |
case-19 | fail→pass | 13,593 | 15,020 | +10% | 1 | 1 | 0% | 2,571 | 3,018 | +17% | 0 | 0 | — |
case-20 | pass→pass | 13,859 | 14,458 | +4% | 1 | 1 | 0% | 2,558 | 3,633 | +42% | 0 | 0 | — |
case-21 | pass→pass | 9,877 | 8,906 | -10% | 1 | 1 | 0% | 2,161 | 2,714 | +26% | 0 | 0 | — |
case-22 | pass→pass | 19,705 | 12,347 | -37% | 1 | 1 | 0% | 2,632 | 3,112 | +18% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +45 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.