xuanguan2020

csv to excel

办公效率v1.0.0
作者:xuanguan2020更新于 2026-05-11csvtoexcel@clawhub_xuanguan2020/csvtoexcel
表格处理#CSV

据 AlphaMoat 统计,截至 2026-09,csv to excel 累计下载 2,736 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 3,925 位,在「办公效率」分类(435 个)中排名第 291 位。

累计安装
249
累计下载
2,736
星标
-
全站排名
#3,925
全站前 78% · 「办公效率」前 67%
平台累计安装累计下载星标评论
ClawHub ↗832,691--
SkillHub ↗2492,736-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

将一个或多个 CSV 文件转换为格式化的 Excel 工作簿,支持中文字符编码识别、表头和列宽调整以及分工作表输出。转换后应检查字符编码、行列和数值是否完整。 不可信 CSV 中的公式样式单元格可能在工作簿中保持有效;转换和分享前应检查或清洗。需要 openpyxl。

资料发布于 2026-10-29

可以用来做什么

  • 将 CSV 转换为 Excel 工作簿
  • 合并文件并整理工作表格式

什么时候用

  • 需要把 CSV 数据交付为 Excel 时
  • 需要检查中文字符和数据完整性时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

转换这些 CSV,并检查中文字符是否正确显示。
将多个 CSV 合并到一个工作簿的不同工作表。

月度数据趋势

累计下载2,736
1,3652,1022,8382026-03 · 累计下载 1,4672026-05 · 累计下载 2,0242026-06 · 累计下载 2,1832026-07 · 累计下载 2,4232026-08 · 累计下载 2,5722026-09 · 累计下载 2,73626-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,736—-
2026-082,572+6.1%-
2026-072,423+11.0%-
2026-062,183+7.9%-
2026-052,024—-
2026-031,467—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.3 KB · ClawHub v1.0.0
---
name: csv-to-excel
description: "Convert CSV files to professionally formatted Excel workbooks with Chinese character support, automatic formatting, and multi-sheet capabilities. Use when users need to: (1) Convert single CSV to Excel, (2) Combine multiple CSV files into one Excel with separate sheets, (3) Format CSV data with headers, borders, and auto-adjusted columns, (4) Handle Chinese or other non-ASCII characters in CSV files, or (5) Create professional Excel reports from CSV data."
---

# CSV To Excel Converter

## Overview

This skill enables conversion of CSV files to Excel format with professional formatting, proper encoding handling for Chinese characters, and support for combining multiple CSV files into a single Excel workbook with separate sheets.
展开全部(共 122 行)
## Quick Start

Use the `csv_to_excel.py` script for all conversions:

```bash
# Single CSV to Excel
python scripts/csv_to_excel.py input.csv output.xlsx

# Multiple CSVs to one Excel (each becomes a sheet)
python scripts/csv_to_excel.py file1.csv file2.csv file3.csv --output combined.xlsx

# With custom sheet names
python scripts/csv_to_excel.py sales.csv inventory.csv --output report.xlsx --sheet-names "销售数据" "库存数据"
```

## Features

### Automatic Encoding Detection
- Detects CSV encoding automatically (UTF-8, GBK, GB2312, UTF-8-SIG)
- Ensures Chinese characters display correctly in Excel
- No manual encoding specification needed

### Professional Formatting
- **Header row**: Bold white text on blue background
- **Borders**: Thin borders around all cells
- **Column widths**: Auto-adjusted based on content (handles Chinese characters properly)
- **Frozen panes**: Header row frozen for easy scrolling
- **Alignment**: Headers centered

### Multi-Sheet Support
- Combine multiple CSV files into one Excel workbook
- Each CSV becomes a separate sheet
- Custom sheet names supported
- Sheet names default to CSV filenames (max 31 characters)

## Common Usage Patterns

### Pattern 1: Single File Conversion
User says: "Convert this data.csv to Excel"

```bash
python scripts/csv_to_excel.py data.csv data.xlsx
```

### Pattern 2: Multiple Files to Multi-Sheet Excel
User says: "Combine these CSV files into one Excel, each file as a separate sheet"

```bash
python scripts/csv_to_excel.py sales_2024.csv sales_2025.csv inventory.csv --output report.xlsx
```

Result: `report.xlsx` with 3 sheets named "sales_2024", "sales_2025", "inventory"

### Pattern 3: Custom Sheet Names
User says: "Create an Excel with these CSVs and name the sheets in Chinese"

```bash
python scripts/csv_to_excel.py q1.csv q2.csv q3.csv q4.csv --output 年度报告.xlsx --sheet-names "第一季度" "第二季度" "第三季度" "第四季度"
```

### Pattern 4: Handling Chinese Content
User says: "This CSV has Chinese text and it shows as garbled characters in Excel"

The script automatically detects encoding and handles Chinese characters:
```bash
python scripts/csv_to_excel.py 中文数据.csv 输出.xlsx
```

## Technical Details

### Encoding Support
The script tries these encodings in order:
1. UTF-8
2. GBK (common for Chinese Windows)
3. GB2312 (simplified Chinese)
4. UTF-8-SIG (UTF-8 with BOM)
5. Latin1 (fallback)

### CSV Dialect Detection
- Automatically detects delimiter (comma, semicolon, tab, etc.)
- Handles quoted fields
- Works with various CSV formats

### Column Width Calculation
- Chinese characters counted as 2 width units
- ASCII characters counted as 1 width unit
- Maximum width capped at 50 for readability
- Adds 2 units padding for visual comfort

## Dependencies

The script requires `openpyxl`:

```bash
pip install openpyxl
```

## Troubleshooting

**Issue**: Chinese characters still appear garbled
- **Solution**: The CSV file may have a rare encoding. Try converting the CSV to UTF-8 first using a text editor.

**Issue**: Sheet name error
- **Solution**: Excel sheet names must be ≤31 characters. The script auto-truncates, but you can specify shorter custom names.

**Issue**: Empty sheets created
- **Solution**: Check that CSV files are not empty and are properly formatted.

**Issue**: Script not found
- **Solution**: Run the script from the skill directory or use the full path: `python .kiro/skills/csv-to-excel/scripts/csv_to_excel.py`

「办公效率」分类下的热门技能

xuanguan2020 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。