Shihao Jiang (Zac)

DOCX Toolkit

辦公效率v1.0.0
作者:Shihao Jiang (Zac)更新於 2026-05-11docx-toolkit@clawhub_zacjiang/docx-toolkit
檔案處理#Docx#Cjk#Doc#Extract#Images

據 AlphaMoat 統計,截至 2026-09,DOCX Toolkit 累計下載 2,944 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 3,770 位,在「辦公效率」分類(435 個)中排名第 278 位。

累計安裝
179
累計下載
2944
星標
-
全站排名
#3,770
全站前 75% · 「辦公效率」前 64%
平台累計安裝累計下載星標評論
ClawHub ↗361329--
SkillHub ↗1792944-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

主文描述處理 DOCX 與舊版 DOC 檔案,並按文件結構匯出段落、表格及嵌入圖像。提取結果可能複製原文中的敏感內容;將輸入和輸出儲存在受限位置,並在隔離環境中管理相關依賴。

資料釋出於 2026-10-27

可以用來做什麼

  • 提取 Word 文件的正文和表格
  • 提取文件內嵌圖像供審閱
  • 整理輸出文字以供後續分析

什麼時候用

  • 需要分析或遷移 Word 文件內容時
  • 確保有權處理文件並妥善保護提取輸出時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

從這個獲准處理的文件提取文字、表格和圖像,並說明輸出將儲存在哪裡。

月度資料趨勢

累計下載2944
487180731262026-03 · 累計下載 6692026-05 · 累計下載 16662026-06 · 累計下載 18602026-07 · 累計下載 21212026-08 · 累計下載 22932026-09 · 累計下載 294426-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092944—-
2026-082293+8.1%-
2026-072121+14.0%-
2026-061860+11.6%-
2026-051666—-
2026-03669—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

2.3 KB · ClawHub v1.0.0
---
name: docx-toolkit
description: Extract text, tables, and images from .docx and legacy .doc files. Handles large documents, CJK text, and complex table structures. Includes deduplication and filtering for extracted images.
author: zacjiang
version: 1.0.0
tags: docx, doc, word, extract, text, tables, images, document, office, CJK, chinese
---

# DOCX Toolkit
展開全部(共 68 行)
A complete toolkit for processing Microsoft Word documents (.docx and legacy .doc formats).

## Capabilities

### 1. Text + Table Extraction (.docx)
```bash
python3 {baseDir}/scripts/extract_text.py input.docx output.txt
```
Extracts all paragraphs and tables with structure preserved. Tables are formatted as pipe-delimited rows for easy parsing.

### 2. Text Extraction (Legacy .doc)
```bash
python3 {baseDir}/scripts/extract_doc_text.py input.doc output.txt
```
Handles legacy OLE2 .doc format using olefile. Extracts Unicode text from the WordDocument stream.

### 3. Image Extraction (.docx)
```bash
python3 {baseDir}/scripts/extract_images.py input.docx output_dir/
```
Extracts all embedded images with:
- Automatic deduplication (MD5 hash comparison)
- Size filtering (skips tiny icons <5KB by default)
- Sequential renaming (img_001.png, img_002.jpg, etc.)

### 4. Image Compression
```bash
python3 {baseDir}/scripts/resize_images.py input_dir/ output_dir/ [--max-width 1024]
```
Batch resize/compress images for API processing (saves 50-70% on vision API costs).

## Dependencies

- Python 3.6+
- `python-docx` — for .docx processing
- `olefile` — for legacy .doc processing  
- `Pillow` — for image resizing (optional, only needed for resize script)

Install:
```bash
pip3 install python-docx olefile Pillow
```

## Use Cases

- **Document analysis**: Extract text for AI review/summarization
- **Migration**: Pull content from Word docs into other formats
- **Image audit**: Extract and review all embedded images
- **Cost optimization**: Compress images before sending to vision APIs
- **Batch processing**: Process multiple documents in a pipeline

## Notes

- Large .doc files (>200MB) may require significant RAM for olefile processing
- Image extraction preserves original format (png/jpg/gif/etc.)
- Deduplication catches exact duplicates; near-duplicates still pass through
- CJK (Chinese/Japanese/Korean) text is fully supported in both extractors

「辦公效率」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。