← 返回 Skills 市场
xuanguan2020

csv to excel

作者 xuanguan2020 · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1551
总下载
0
收藏
14
当前安装
1
版本数
在 OpenClaw 中安装
/install csvtoexcel
功能描述
Convert CSV files to professionally formatted Excel workbooks with Chinese character support, automatic formatting, and multi-sheet capabilities. Use when us...
使用说明 (SKILL.md)

\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
安全使用建议
This skill appears coherent and implements only CSV-to-Excel conversion. Before using: (1) install openpyxl from a trusted source (pip install openpyxl) in a virtual environment; (2) only point the script at CSV files you trust (the script will read files you pass it); (3) be cautious about where you write the output file—avoid system directories that require elevated permissions; (4) if you need higher assurance, review the included csv_to_excel.py yourself or run it in an isolated environment. No network or secret-exfiltration behavior was found.
功能分析
Type: OpenClaw Skill Name: csvtoexcel Version: 1.0.0 The skill bundle provides a utility to convert CSV files to Excel, supporting multiple files, custom sheet names, and Chinese character encoding. The `SKILL.md` documentation accurately describes the functionality and provides legitimate usage examples without any prompt injection attempts. The `csv_to_excel.py` script uses standard Python libraries (`csv`, `pathlib`, `openpyxl`) for file reading, parsing, and Excel generation. All file operations are local and directly align with the stated purpose, with no evidence of data exfiltration, malicious execution, persistence mechanisms, or obfuscation. While any script accepting file paths as arguments could be vulnerable to path traversal if inputs are not sanitized by the calling environment, the script itself does not exhibit malicious intent or design to exploit such vulnerabilities.
能力评估
Purpose & Capability
The name/description (CSV→Excel with Chinese support and formatting) aligns with the provided script and README. Required capabilities (encoding detection, formatting, multi-sheet output) are implemented in the script; no unrelated capabilities or credentials are requested.
Instruction Scope
SKILL.md instructs running the provided Python script with CSV paths and an output path. The script only reads the specified CSV files and writes the specified Excel file. It does not read other system files, environment variables, or send data externally.
Install Mechanism
There is no install spec; installation is manual via pip for the single declared dependency (openpyxl). That is proportional and expected for a Python script that writes Excel files.
Credentials
No environment variables, credentials, or config paths are required. The script only operates on files passed on the command line, which is appropriate for the stated purpose.
Persistence & Privilege
The skill is not marked always:true and does not modify other skills or system configuration. It has no persistent or privileged behavior beyond creating the requested Excel output file.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install csvtoexcel
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /csvtoexcel 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: CSV to Excel Converter with formatting and Chinese character support. - Added csv_to_excel.py script for converting single or multiple CSV files into Excel workbooks. - Professional formatting: auto-detects headers, applies bold colored header row, borders, and column width adjustment. - Handles Chinese and other non-ASCII characters; automatic encoding detection (UTF-8, GBK, GB2312, etc.). - Supports combining multiple CSVs into one Excel file, each as a separate sheet. - Allows custom sheet names, with compatibility for Excel's character limits. - Includes troubleshooting guidance and usage examples in documentation.
元数据
Slug csvtoexcel
版本 1.0.0
许可证
累计安装 16
当前安装数 14
历史版本数 1
常见问题

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。

💬 留言讨论