← Back to Skills Marketplace
longjf25

Doc Xls2docx Xlsx

by juanfenglong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
106
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install doc-xls2docx-xlsx
Description
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...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install doc-xls2docx-xlsx
  3. After installation, invoke the skill by name or use /doc-xls2docx-xlsx
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug doc-xls2docx-xlsx
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 106 downloads so far.

How do I install Doc Xls2docx Xlsx?

Run "/install doc-xls2docx-xlsx" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Doc Xls2docx Xlsx free?

Yes, Doc Xls2docx Xlsx is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Doc Xls2docx Xlsx support?

Doc Xls2docx Xlsx is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Doc Xls2docx Xlsx?

It is built and maintained by juanfenglong (@longjf25); the current version is v1.0.0.

💬 Comments