360 Secure SkillHub
360 安全技能中心

Image To Excel

该 Skill 接收含表格的图片,借助宿主的 image 工具按行列提取表格数据为 JSON,随后校验行列数一致性、数字格式与中文字符识别结果,再调用脚本生成 .xlsx 文件,并告知保存位置、展示前 5 行预览。

openlark
openlark
热度 20.28
最近更新 2026-06-06 10:55:19
分类:效率依赖:内部调用大模型 / 代码执行 / 读写文件应用场景:文件转换 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add image-to-excel
Metadata
name
image-to-excel
description
Extract table content from images, retrieve row/column data, correct recognition errors, and generate a well-formatted Excel file.

Image to Excel

Extract tables from images and generate .xlsx files.

Use Cases

Use when users upload images containing tables and request "convert to table", "extract table", or "generate Excel".

Workflow

1. Analyze Image

Use the image tool to load the user-uploaded image, with a prompt requesting row-by-row, column-by-column table data extraction:

Extract all table data from the image row by row and column by column, returning it as a JSON array.
Format: [[row1col1, row1col2, ...], [row2col1, row2col2, ...], ...]
Notes:
- The first row may be a header; keep it as-is
- Split merged cells into individual cells and fill with the same value
- Preserve original formatting for amounts and numbers
- Use empty string "" for missing cells

2. Data Validation & Correction

After receiving the JSON data from the image model, check and correct:

  • Row/column count consistency (fill in missing cells)
  • Number format correctness (remove extra spaces, unify decimal points)
  • Chinese character recognition accuracy (fix obvious typos)
  • Header completeness (infer missing headers from content)

Store the corrected data in the variable rows.

3. Write to Excel

Call the generation script with the corrected data:

python3 scripts/gen_excel.py <output_path> '<json_data>'
  • output_path: Output path, e.g., /root/.openclaw/workspace/table_extracted.xlsx
  • json_data: Corrected 2D array as a JSON string

4. Output Results

Inform the user of the file save location and display a preview of the first 5 rows for confirmation.