excel转csv、tsv、json或txt格式

👤 七仔的AI工具箱 📦 v1.0.0 ⭐ 4.5 ⬇️ 63 下载
📄 办公效率 免费

📖 技能介绍

excel-to-table 技能包

Excel / XLSX / XLS → CSV / TSV / JSON / TXT,零 token 本地转换

📦 包含脚本

脚本 功能 依赖
excel-to-csv.py Excel → CSV(单本) openpyxl + xlrd
excel-to-csv-batch.py Excel → CSV(批量) openpyxl + xlrd
excel-to-tsv.py Excel → TSV(单本) openpyxl + xlrd
excel-to-tsv-batch.py Excel → TSV(批量) openpyxl + xlrd
excel-to-json.py Excel → JSON(单本) openpyxl + xlrd
excel-to-json-batch.py Excel → JSON(批量) openpyxl + xlrd
excel-to-txt.py Excel → TXT 表格(单本) openpyxl + xlrd
excel-to-txt-batch.py Excel → TXT 表格(批量) openpyxl + xlrd
excel-to-all.py Excel → 四种格式一次导出(单本) openpyxl + xlrd

🔄 完整流水线

Excel(XLSX/XLS)  →  CSV  →  AI分析/清洗
               →  TSV  →  数据导入
               →  JSON →  API/代码调用
               →  TXT  →  纯文本阅读/OCR素材

安装依赖(一次性)

pip install openpyxl xlrd

更多技能请访问小葱技能站7w4.net。

🚀 使用方法

单本转换

# Excel → CSV
python3 excel-to-csv.py input.xlsx [output.csv]

# Excel → TSV
python3 excel-to-tsv.py input.xlsx [output.tsv]

# Excel → JSON
python3 excel-to-json.py input.xlsx [output.json]

# Excel → TXT(纯文本表格)
python3 excel-to-txt.py input.xlsx [output.txt]

# Excel → 四种格式一次性导出
python3 excel-to-all.py input.xlsx

批量转换

# 批量 Excel → CSV
python3 excel-to-csv-batch.py /path/to/excels/

# 批量 Excel → TSV
python3 excel-to-tsv-batch.py /path/to/excels/

# 批量 Excel → JSON
python3 excel-to-json-batch.py /path/to/excels/

# 批量 Excel → TXT
python3 excel-to-txt-batch.py /path/to/excels/

📋 输出格式说明

CSV / TSV

  • 首行 = 表头
  • 逗号/制表符分隔
  • 中文编码 UTF-8(CSV with BOM 方便 Excel 打开)

JSON

  • 数组格式:[ {列1: 值1, 列2: 值2, ...}, ... ]
  • 保留表头作为 key
  • 空值输出为空字符串(JSON null 可选)

TXT

  • 等宽表格格式,用空格对齐列
  • 适合快速浏览内容
  • 不保留格式信息

⚠️ 已知限制

  • 只读第一个工作表:如需多表请分次指定
  • 公式:读公式计算后的值,不保留公式本身
  • 图片/宏/VBA:不支持
  • 超大文件(>100MB):建议用 CSV 分批处理

📁 文件结构

excel-to-table/
├── SKILL.md                # 本文件
├── excel-to-csv.py         # Excel → CSV(单本)
├── excel-to-csv-batch.py   # Excel → CSV(批量)
├── excel-to-tsv.py         # Excel → TSV(单本)
├── excel-to-tsv-batch.py   # Excel → TSV(批量)
├── excel-to-json.py        # Excel → JSON(单本)
├── excel-to-json-batch.py  # Excel → JSON(批量)
├── excel-to-txt.py         # Excel → TXT(单本)
├── excel-to-txt-batch.py   # Excel → TXT(批量)
└── excel-to-all.py         # Excel → 四种格式一次导出

版本:v1.0(2026-08-07)初始版本,支持 XLSX / XLS → CSV / TSV / JSON / TXT

🤖 AI 评测

这个Skill质量良好,提供了Excel转四种常用格式的完整工具,文档清晰易懂,使用简单。它最大的优点是功能整合度高、输出格式考虑周全(如CSV带BOM方便Excel打开)。不足之处是只能读取第一个工作表,不支持公式、图片等复杂内容。如果你需要转换简单的Excel数据,这是一个值得信赖的工具;但处理复杂Excel文件时需要留意其限制。

📊 多维度评分

适应性4.5
规范性4.5
有效性4.4
可靠性4.3
可信度5

📁 包含文件 (10 个)

📄 SKILL.md 3.2 KB
📄 excel-to-all.py 3.1 KB
📄 excel-to-csv-batch.py 2.1 KB
📄 excel-to-csv.py 2.4 KB
📄 excel-to-json-batch.py 2.2 KB
📄 excel-to-json.py 2.2 KB
📄 excel-to-tsv-batch.py 1.9 KB
📄 excel-to-tsv.py 2 KB
📄 excel-to-txt-batch.py 2.2 KB
📄 excel-to-txt.py 2.3 KB