csv to excel
/install csvtoexcel
\r \r
CSV To Excel Converter\r
\r
Overview\r
\r 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.\r \r
Quick Start\r
\r
Use the csv_to_excel.py script for all conversions:\r
\r
# Single CSV to Excel\r
python scripts/csv_to_excel.py input.csv output.xlsx\r
\r
# Multiple CSVs to one Excel (each becomes a sheet)\r
python scripts/csv_to_excel.py file1.csv file2.csv file3.csv --output combined.xlsx\r
\r
# With custom sheet names\r
python scripts/csv_to_excel.py sales.csv inventory.csv --output report.xlsx --sheet-names "销售数据" "库存数据"\r
```\r
\r
## Features\r
\r
### Automatic Encoding Detection\r
- Detects CSV encoding automatically (UTF-8, GBK, GB2312, UTF-8-SIG)\r
- Ensures Chinese characters display correctly in Excel\r
- No manual encoding specification needed\r
\r
### Professional Formatting\r
- **Header row**: Bold white text on blue background\r
- **Borders**: Thin borders around all cells\r
- **Column widths**: Auto-adjusted based on content (handles Chinese characters properly)\r
- **Frozen panes**: Header row frozen for easy scrolling\r
- **Alignment**: Headers centered\r
\r
### Multi-Sheet Support\r
- Combine multiple CSV files into one Excel workbook\r
- Each CSV becomes a separate sheet\r
- Custom sheet names supported\r
- Sheet names default to CSV filenames (max 31 characters)\r
\r
## Common Usage Patterns\r
\r
### Pattern 1: Single File Conversion\r
User says: "Convert this data.csv to Excel"\r
\r
```bash\r
python scripts/csv_to_excel.py data.csv data.xlsx\r
```\r
\r
### Pattern 2: Multiple Files to Multi-Sheet Excel\r
User says: "Combine these CSV files into one Excel, each file as a separate sheet"\r
\r
```bash\r
python scripts/csv_to_excel.py sales_2024.csv sales_2025.csv inventory.csv --output report.xlsx\r
```\r
\r
Result: `report.xlsx` with 3 sheets named "sales_2024", "sales_2025", "inventory"\r
\r
### Pattern 3: Custom Sheet Names\r
User says: "Create an Excel with these CSVs and name the sheets in Chinese"\r
\r
```bash\r
python scripts/csv_to_excel.py q1.csv q2.csv q3.csv q4.csv --output 年度报告.xlsx --sheet-names "第一季度" "第二季度" "第三季度" "第四季度"\r
```\r
\r
### Pattern 4: Handling Chinese Content\r
User says: "This CSV has Chinese text and it shows as garbled characters in Excel"\r
\r
The script automatically detects encoding and handles Chinese characters:\r
```bash\r
python scripts/csv_to_excel.py 中文数据.csv 输出.xlsx\r
```\r
\r
## Technical Details\r
\r
### Encoding Support\r
The script tries these encodings in order:\r
1. UTF-8\r
2. GBK (common for Chinese Windows)\r
3. GB2312 (simplified Chinese)\r
4. UTF-8-SIG (UTF-8 with BOM)\r
5. Latin1 (fallback)\r
\r
### CSV Dialect Detection\r
- Automatically detects delimiter (comma, semicolon, tab, etc.)\r
- Handles quoted fields\r
- Works with various CSV formats\r
\r
### Column Width Calculation\r
- Chinese characters counted as 2 width units\r
- ASCII characters counted as 1 width unit\r
- Maximum width capped at 50 for readability\r
- Adds 2 units padding for visual comfort\r
\r
## Dependencies\r
\r
The script requires `openpyxl`:\r
\r
```bash\r
pip install openpyxl\r
```\r
\r
## Troubleshooting\r
\r
**Issue**: Chinese characters still appear garbled\r
- **Solution**: The CSV file may have a rare encoding. Try converting the CSV to UTF-8 first using a text editor.\r
\r
**Issue**: Sheet name error\r
- **Solution**: Excel sheet names must be ≤31 characters. The script auto-truncates, but you can specify shorter custom names.\r
\r
**Issue**: Empty sheets created\r
- **Solution**: Check that CSV files are not empty and are properly formatted.\r
\r
**Issue**: Script not found\r
- **Solution**: Run the script from the skill directory or use the full path: `python .kiro/skills/csv-to-excel/scripts/csv_to_excel.py`\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install csvtoexcel - 安装完成后,直接呼叫该 Skill 的名称或使用
/csvtoexcel触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
csv to excel 是什么?
Convert CSV files to professionally formatted Excel workbooks with Chinese character support, automatic formatting, and multi-sheet capabilities. Use when us... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1551 次。
如何安装 csv to excel?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install csvtoexcel」即可一键安装,无需额外配置。
csv to excel 是免费的吗?
是的,csv to excel 完全免费(开源免费),可自由下载、安装和使用。
csv to excel 支持哪些平台?
csv to excel 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 csv to excel?
由 xuanguan2020(@xuanguan2020)开发并维护,当前版本 v1.0.0。