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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install csvtoexcel - After installation, invoke the skill by name or use
/csvtoexcel - Provide required inputs per the skill's parameter spec and get structured output
What is csv to excel?
Convert CSV files to professionally formatted Excel workbooks with Chinese character support, automatic formatting, and multi-sheet capabilities. Use when us... It is an AI Agent Skill for Claude Code / OpenClaw, with 1551 downloads so far.
How do I install csv to excel?
Run "/install csvtoexcel" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is csv to excel free?
Yes, csv to excel is completely free (open-source). You can download, install and use it at no cost.
Which platforms does csv to excel support?
csv to excel is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created csv to excel?
It is built and maintained by xuanguan2020 (@xuanguan2020); the current version is v1.0.0.