← 返回 Skills 市场
longjf25

Doc Xls2docx Xlsx

作者 juanfenglong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
106
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install doc-xls2docx-xlsx
功能描述
Skill for batch converting legacy Office files (.doc, .xls) to modern formats (.docx, .xlsx). Use when user asks to convert .doc/.xls files, migrate Office d...
使用说明 (SKILL.md)

\r \r

doc_xls2docx_xlsx\r

\r

技能说明 / Skill Description\r

\r

概述 / Overview\r

\r This skill converts legacy Microsoft Office files to modern formats:\r

  • .doc → .docx using Word COM automation (Windows only, requires Word)\r
  • .xls → .xlsx using Python (xlrd + openpyxl, cross-platform)\r \r 本技能用于将旧版 Microsoft Office 文件转换为现代格式:\r
  • .doc → .docx:使用 Word COM 自动化(仅 Windows,需要安装 Word)\r
  • .xls → .xlsx:使用 Python 库(xlrd + openpyxl,跨平台)\r \r ---\r \r

前置依赖 / Prerequisites\r

\r

.doc → .docx 转换需要 / For .doc Conversion\r

\r Windows 系统 + Microsoft Word 已安装\r \r 使用 pywin32 通过 Word COM 接口进行转换,无需 LibreOffice。\r \r Requires Windows OS and Microsoft Word installed. Uses pywin32 Word COM interface.\r \r

.xls → .xlsx 转换需要 / For .xls Conversion\r

\r Python 包依赖 / Python Dependencies:\r \r

pip install xlrd openpyxl\r
```\r
\r
---\r
\r
## 使用方法 / Usage\r
\r
### 1. 转换单个文件 / Convert Single File\r
\r
#### .doc → .docx\r
\r
```powershell\r
python \x3Cskill_dir>/scripts/doc_to_docx_com.py input.doc [output.docx]\r
```\r
\r
#### .xls → .xlsx\r
\r
```powershell\r
python \x3Cskill_dir>/scripts/xls_to_xlsx.py input.xls [output.xlsx]\r
```\r
\r
### 2. 批量转换目录 / Batch Convert Directory\r
\r
#### .doc → .docx\r
\r
```powershell\r
python \x3Cskill_dir>/scripts/doc_to_docx_com.py "C:\path	o\directory"\r
```\r
\r
#### .xls → .xlsx\r
\r
```powershell\r
python \x3Cskill_dir>/scripts/xls_to_xlsx.py --batch "C:\path	o\directory"\r
```\r
\r
---\r
\r
## 转换脚本说明 / Conversion Scripts\r
\r
### doc_to_docx_com.py\r
\r
- **平台**: Windows only (requires Word COM)\r
- **功能**: 将 .doc 文件转换为 .docx 格式\r
- **特点**: 保留原文档格式、样式、图片等所有内容\r
- **原理**: 使用 pywin32 调用 Word COM 接口,以只读方式打开并另存为 .docx\r
\r
### xls_to_xlsx.py\r
\r
- **平台**: Cross-platform (Windows/macOS/Linux)\r
- **功能**: 将 .xls 文件转换为 .xlsx 格式\r
- **特点**: 支持多 Sheet、日期格式、字体样式、单元格对齐等\r
- **原理**: 使用 xlrd 读取 .xls,使用 openpyxl 创建 .xlsx\r
\r
---\r
\r
## 示例 / Examples\r
\r
### 示例 1: 批量转换当前目录所有旧格式文件\r
\r
**Example 1: Batch convert all legacy files in current directory**\r
\r
```powershell\r
# 转换所有 .doc 文件\r
python doc_to_docx_com.py "C:\Users\Documents"\r
\r
# 转换所有 .xls 文件\r
python xls_to_xlsx.py --batch "C:\Users\Documents"\r
```\r
\r
### 示例 2: 转换单个文件并指定输出位置\r
\r
**Example 2: Convert single file with output path**\r
\r
```powershell\r
# .doc 转换\r
python doc_to_docx_com.py "input.doc" "output.docx"\r
\r
# .xls 转换\r
python xls_to_xlsx.py "input.xls" "output.xlsx"\r
```\r
\r
---\r
\r
## 注意事项 / Important Notes\r
\r
1. **文件覆盖**: 如果输出文件已存在,会被自动覆盖\r
2. **临时文件**: Word COM 转换会在同一目录生成临时文件,转换完成后自动清理\r
3. **大文件**: 超大 .xls 文件(>10MB)可能转换较慢\r
4. **编码问题**: 某些特殊字符可能出现编码问题,脚本已做处理\r
\r
1. **File Overwrite**: Existing output files will be overwritten\r
2. **Temp Files**: Word COM creates temp files in same directory, auto-cleaned after conversion\r
3. **Large Files**: Very large .xls files (>10MB) may convert slowly\r
4. **Encoding**: Special characters are handled by the scripts\r
\r
---\r
\r
## 错误处理 / Error Handling\r
\r
| 错误类型 | 解决方法 |\r
|----------|----------|\r
| "pywin32 not found" | 运行: `pip install pywin32` |\r
| "Word COM failed" | 确保 Word 已安装且可正常打开 |\r
| "xlrd import error" | 运行: `pip install xlrd openpyxl` |\r
| "Permission denied" | 关闭正在使用的源文件 |\r
\r
| Error | Solution |\r
|--------|----------|\r
| "pywin32 not found" | Run: `pip install pywin32` |\r
| "Word COM failed" | Ensure Word is installed and can open files |\r
| "xlrd import error" | Run: `pip install xlrd openpyxl` |\r
| "Permission denied" | Close the source file if it's open |\r
\r
---\r
\r
## 脚本执行流程 / Script Execution Flow\r
\r
### doc_to_docx_com.py 流程\r
\r
1. 初始化 Python COM\r
2. 创建 Word Application 对象(不可见)\r
3. 以只读方式打开 .doc 文件\r
4. 另存为 .docx 格式 (FileFormat=16)\r
5. 关闭文档,退出 Word\r
6. 输出转换结果\r
\r
### xls_to_xlsx.py 流程\r
\r
1. 使用 xlrd 打开 .xls 文件\r
2. 创建新的 openpyxl 工作簿\r
3. 遍历每个 Sheet,复制数据\r
4. 处理日期、布尔值、错误类型等特殊格式\r
5. 保存为 .xlsx 文件\r
6. 输出转换结果\r
安全使用建议
This skill appears to do what it claims and has no network calls or secret requirements, but take these precautions before using it: - Run conversions on copies of files, not originals, so you can recover if something goes wrong. - Be cautious with untrusted .doc files: opening them with Word can execute macros or fetch external content. Prefer converting on an isolated or sandboxed Windows machine, enable Protected View, or disable macros before batch conversion. - Review the included scripts yourself (they are short and local) or run them in a Python virtual environment after installing xlrd/openpyxl/pywin32 as recommended. - Test with a small sample set first to confirm formatting/encoding behavior; the xls→xlsx script has noncritical date-handling code paths that may behave differently on some inputs. - If you need enterprise deployment, consider adding logging, input validation, and explicit safeguards around macro handling and temp file locations.
功能分析
Type: OpenClaw Skill Name: doc-xls2docx-xlsx Version: 1.0.0 The skill bundle is a legitimate tool for converting legacy Office files (.doc, .xls) to modern formats (.docx, .xlsx). The scripts (doc_to_docx_com.py and xls_to_xlsx.py) use standard libraries like pywin32 for Word COM automation and xlrd/openpyxl for Excel processing, with no evidence of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
The name/description, SKILL.md, and included scripts align: doc_to_docx_com.py uses Word COM for .doc→.docx (Windows+Word required) and xls_to_xlsx.py uses xlrd/openpyxl for .xls→.xlsx. No unrelated binaries, env vars, or config paths are requested.
Instruction Scope
Runtime instructions are narrowly scoped to running the two scripts and installing the indicated Python packages. The doc conversion uses local Word COM automation which will open the provided .doc files — this is expected for the stated purpose but can expose the host to risks inherent in opening untrusted Word documents (macros, external links, embedded content). SKILL.md does not mention disabling macros or using protected/sandboxed view; consider adding guidance to avoid processing untrusted files on production systems.
Install Mechanism
This is an instruction-only skill with no install spec that pulls code from arbitrary URLs. All code is included in the bundle and there are no network fetches or archive extracts in the install phase.
Credentials
No environment variables, credentials, or config paths are requested. Requiring Microsoft Word and Python packages is proportionate to the conversion tasks.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or system configuration, and contains no persistence mechanisms. It runs locally and acts only on user-specified files/directories.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install doc-xls2docx-xlsx
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /doc-xls2docx-xlsx 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Batch conversion of legacy Office files (.doc, .xls) to modern formats (.docx, .xlsx). - Supports .doc to .docx conversion using Word COM automation (Windows only, requires Microsoft Word). - Supports .xls to .xlsx conversion using Python libraries (xlrd, openpyxl); works cross-platform. - Provides both single file and directory batch conversion commands. - Includes clear prerequisites, usage instructions, error handling, and notes for file overwriting and encoding.
元数据
Slug doc-xls2docx-xlsx
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Doc Xls2docx Xlsx 是什么?

Skill for batch converting legacy Office files (.doc, .xls) to modern formats (.docx, .xlsx). Use when user asks to convert .doc/.xls files, migrate Office d... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 106 次。

如何安装 Doc Xls2docx Xlsx?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install doc-xls2docx-xlsx」即可一键安装,无需额外配置。

Doc Xls2docx Xlsx 是免费的吗?

是的,Doc Xls2docx Xlsx 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Doc Xls2docx Xlsx 支持哪些平台?

Doc Xls2docx Xlsx 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Doc Xls2docx Xlsx?

由 juanfenglong(@longjf25)开发并维护,当前版本 v1.0.0。

💬 留言讨论