Back to Registry
View Author Profile
Official Verified
Document Organizer
Skill by byteuser1977
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/byteuser1977/document-organizerOr
文档整理技能 (document-organizer)
概述
专业的文档批量处理技能,支持旧版 Office 文档(.doc/.xls)高质量转换为 Markdown,保持格式结构完整。
核心能力
✅ 格式转换
- Word 文档:
.doc→.md(LibreOffice 直接转换) - Word 文档:
.docx→.md(LibreOffice 直接转换) - Excel 表格:
.xls→.xlsx→.md(保留表格结构) - PowerPoint:
.ppt→.pptx→.md(可选支持) - 现代格式:
.xlsx/.pptx→.md(MarkItDown 直接处理)
✅ 批量处理
- 支持按目录批量转换
- 自动保持原目录结构
- 分类处理不同类型文件
- 错误自动记录,不中断流程
✅ 质量保证
- 完美保留标题层级(H1-H6)
- 表格结构完整(Markdown 表格)
- 加粗/斜体样式保留
- 列表有序/无序完整
- 中文无乱码(UTF-8 编码)
快速开始
1. 环境准备
# 安装 LibreOffice(系统级)
# 下载: https://zh-cn.libreoffice.org/
# 安装 Python 依赖
pip install markitdown[docx,xlsx]
2. 使用方法
# 交互模式(推荐)
npx skills run document-organizer
# 命令行参数
npx skills run document-organizer --source "源目录" --output "输出目录" --type doc,xls
3. 配置
首次运行会检测 LibreOffice 路径,默认:
- Windows:
D:\Program Files\LibreOffice\program\soffice.exe - Linux:
/usr/bin/soffice - macOS:
/Applications/LibreOffice.app/Contents/MacOS/soffice
详细功能
文档类型处理
| 源格式 | 转换流程 | 输出格式 | 质量 |
|---|---|---|---|
.doc | LibreOffice → Markdown | .md | ✅ 完美 |
.docx | LibreOffice → Markdown | .md | ✅ 完美 |
.xls | LibreOffice → .xlsx → MarkItDown → .md | .md | ✅ 完美 |
.xlsx | MarkItDown → .md | .md | ✅ 完美 |
.ppt | LibreOffice → .pptx → MarkItDown → .md | .md | ✅ 良好 |
.pptx | MarkItDown → .md | .md | ✅ 良好 |
.pdf | MarkItDown → .md | .md | ✅ 优秀(文本+表格) |
批量处理策略
方案一:分类批量(推荐)
批量转换所有 .doc 文件:
soffice --convert-to md *.doc
批量转换所有 .docx 文件:
soffice --convert-to md *.docx
批量转换所有 .xls 文件:
soffice --convert-to xlsx *.xls → markitdown *.xlsx
批量转换所有 .ppt 文件:
soffice --convert-to pptx *.ppt → markitdown *.pptx
方案二:递归处理
扫描目录树,按文件类型分组
分别批量转换每个子目录
保持完整目录结构输出
使用示例
示例 1: 转换单个目录
# 扫描源目录
npx skills run document-organizer --source "G:\历史文档" --output "d:\知识库"
输出结构:
知识库/
├── 项目A/
│ ├── 需求文档.md
│ └── 设计文档.md
└── 项目B/
└── 会议记录.md
示例 2: 仅处理 Word 文档
npx skills run document-organizer --source "G:\docs" --output "d:\md" --filter .doc,.docx
示例 3: 处理 PDF 文档
npx skills run document-organizer --source "G:\pdfs" --type pdf --output "d:\pdf_md"
示例 4: 先扫描统计
npx skills run document-organizer --scan-only "G:\docs"
# 输出: 文件统计,不执行转换
配置选项
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
--source | string | 必需 | 源目录路径 |
--output | string | ./output | 输出目录 |
--type | string | doc,xls,docx,xlsx,ppt,pptx,pdf | 处理的文件类型(逗号分隔) |
--soffice-path | string | 自动检测 | LibreOffice soffice.exe 路径 |
--log-file | string | conversion.log | 日志文件路径 |
--dry-run | bool | false | 仅模拟,不实际转换 |
性能参考
测试环境: i5 CPU, 16GB RAM, SSD...
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-byteuser1977-document-organizer": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.