# Excel Multi Sheet Dynamic Analysis

用于分析包含多个Sheet的Excel文件，动态判断数据量级以决定是否转换为Parquet进行大文件处理，并支持跨Sheet的特定字段统计、数据清洗、交叉分析与可视化，最终生成...

- Repository: https://github.com/OpenSenseNova/SenseNova-Skills (6002 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add OpenSenseNova/SenseNova-Skills --skill excel-multi-sheet-dynamic-analysis -g -a claude-code -y`
Codex: `npx skills add OpenSenseNova/SenseNova-Skills --skill excel-multi-sheet-dynamic-analysis -g -a codex -y`
Cursor: `npx skills add OpenSenseNova/SenseNova-Skills --skill excel-multi-sheet-dynamic-analysis -g -a cursor -y`
Gemini CLI: `npx skills add OpenSenseNova/SenseNova-Skills --skill excel-multi-sheet-dynamic-analysis -g -a gemini-cli -y`

## Description

用于分析包含多个Sheet的Excel文件，动态判断数据量级以决定是否转换为Parquet进行大文件处理，并支持跨Sheet的特定字段统计、数据清洗、交叉分析与可视化，最终生成带下载链接的汇总报告。

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

Step1 遍历所有sheet，灵活定位目标列并统计特定类型字段的数量。
```python
target_col_keyword = 'type' # 占位示例
target_val_keyword = 'varchar' # 占位示例

total_target_count = 0
target_details = []

for sheet_name in wb.sheetnames:
    ws = wb[sheet_name]
    raw_data = list(ws.iter_rows(values_only=True))

    # 实用技巧：灵活策略定位目标列，通过扫描前几行数据内容定位表头行
    header_row_idx = None
    for i, row in enumerate(raw_data):
        if any(cell and isinstance(cell, str) and target_col_keyword in str(cell).lower() for cell in row):
            header_row_idx = i
            break

    if header_row_idx is not None:
        header = raw_data[header_row_idx]
        type_col_idx = next((j for j, col in enumerate(header) if col and target_col_keyword in str(col).lower()), None)
        
        if type_col_idx is not None:
            target_count = 0
            target_fields = []
            for i in range(header_row_idx + 1, len(raw_data)):
                row = raw_data[i]
                if len(row) <= type_col_idx:
                    continue
                cell_val = row[type_col_idx]
                if cell_val and isinstance(cell_val, str) and target_val_keyword in cell_val.lower():
                    target_count += 1
                    field_name = row[0] if len(row) > 0 else None
                    if field_name and field_name not in target_fields:
                        target_fields.append(field_name)
                        
            total_target_count += target_count
            target_details.append({
                'sheet': sheet_name,
                'target_count': target_count,
                'target_fields': target_fields[:10]
            })
```

Step2 对特定Sheet进行数据清洗、分类映射、多维度评分及交叉聚合分析。
```python
import pandas as pd
import re

# 读取特定Sheet并处理列名
sheet1_df = pd.read_excel(file_path, sheet_name='Sheet1', engine='openpyxl', header=None, skiprows=1)
sheet1_df.columns = ['id_col', 'name_col', 'year_col', 'value_col', 'group_col'] # 占位示例

The rest: https://github.com/OpenSenseNova/SenseNova-Skills/blob/HEAD/skills/sn-da-excel-workflow/capability/excel-reading/specific-sheet-reading/SKILL.md
