Install
openclaw skills install yuyonghao-office-reader读取本地 Word、Excel、PowerPoint、PDF 及多种文本格式文件,支持内容解析和摘要输出。
openclaw skills install yuyonghao-office-reader统一的 Office 文档和本地文件读取技能,支持 Word、Excel、PowerPoint、PDF 及多种文本格式。
| 类型 | 扩展名 | 读取方式 |
|---|---|---|
| Markdown | .md, .markdown | 原生文本 |
| 纯文本 | .txt | 原生文本 |
| CSV | .csv | 原生文本 |
| JSON | .json | 原生 JSON 解析 |
| YAML | .yaml, .yml | PyYAML |
| HTML | .html, .htm | 原生文本 |
| Word | .docx, .doc | python-docx |
| Excel | .xlsx, .xls | pandas + openpyxl |
| PowerPoint | .pptx, .ppt | python-pptx |
.pdf | pypdf / summarize |
# 读取 Word 文档
.\skills\office-reader\office-reader.ps1 -FilePath "C:\path\to\document.docx"
# 读取 Excel 文件
.\skills\office-reader\office-reader.ps1 -FilePath "C:\path\to\data.xlsx"
# 读取 PowerPoint
.\skills\office-reader\office-reader.ps1 -FilePath "C:\path\to\presentation.pptx"
# 读取 PDF(前 10 页)
.\skills\office-reader\office-reader.ps1 -FilePath "C:\path\to\report.pdf"
直接对我说:
我会自动调用 office-reader 脚本处理。
summarize C:\path\to\file.pdf
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
-FilePath | string | 必填 | 要读取的文件路径 |
-OutputFormat | string | "text" | 输出格式(text/json/markdown) |
-MaxLines | int | 1000 | 最大输出行数(防止过长) |
📄 读取文件:C:\docs\report.docx
📋 文件类型:.docx
✅ 使用 Word 模式读取 (python-docx)...
[文档标题]
[第一段内容...]
[第二段内容...]
✅ 读取完成!
📄 读取文件:C:\data\sales.xlsx
📋 文件类型:.xlsx
✅ 使用 Excel 模式读取 (pandas + openpyxl)...
📊 工作表数量:3
📋 工作表名称:['一月', '二月', '三月']
=== 工作表:一月 ===
行数:150, 列数:8
列名:['日期', '产品', '销售额', '利润', ...]
前 20 行数据:
日期 产品 销售额 利润
0 2026-01-01 产品 A 1000 200
1 2026-01-02 产品 B 1500 350
...
✅ 读取完成!
📄 读取文件:C:\presentations\demo.pptx
📋 文件类型:.pptx
✅ 使用 PowerPoint 模式读取 (python-pptx)...
📊 幻灯片数量:15
=== 幻灯片 1 ===
布局:Title Slide
Title: 项目演示
Subtitle: 2026 年 Q1 汇报
=== 幻灯片 2 ===
布局:Title and Content
Title: 目录
Content: 1. 项目背景...
✅ 读取完成!
已安装的 Python 库:
.docx/.xlsx/.pptx 格式(Office 2007+).doc/.xls/.ppt 需要转换解决: 检查文件路径是否正确,文件是否被其他程序占用
解决: 确保 .xlsx 格式(非 .xls),或转换为 CSV
解决: 可能是扫描件,需要 OCR(暂不支持)
版本: v0.1.0
创建时间: 2026-03-18
作者: 小蒲萄 🦞