← Back to Skills Marketplace
263
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install extract-pic-text
Description
Extract specified-position text from image filenames using custom delimiters, supporting batch processing, sorting, deduplication, and multiple image formats.
README (SKILL.md)
extract-pic-text
从图片文件名中提取指定位置的文本内容。支持自定义分隔符、提取位置,可批量处理目录中的图片文件。
功能特点
- 支持自定义分隔符(默认为
_) - 支持指定提取位置(默认为第2部分,即第一个和第二个分隔符之间的内容)
- 支持多种图片格式(jpg, jpeg, png, gif, bmp, webp, tiff, tif)
- 可自定义图片扩展名列表
- 支持结果排序和去重
- 可输出到文件或 stdout
用法
基本用法
# 提取默认位置(第一个和第二个下划线之间的文本)
python3 scripts/extract_pic_text.py /path/to/images
# 示例:BIN245_515194318_0128N.jpg -> 515194318
高级选项
# 使用不同的分隔符和位置
python3 scripts/extract_pic_text.py /path/to/images -d '-' -p 0
# 示例:img-12345-test.jpg -> img (位置0)
# 指定图片扩展名
python3 scripts/extract_pic_text.py /path/to/images -e .jpg .png
# 结果排序并去重
python3 scripts/extract_pic_text.py /path/to/images --sort --unique
# 保存到文件
python3 scripts/extract_pic_text.py /path/to/images -o result.txt
完整参数说明
| 参数 | 简写 | 说明 | 默认值 |
|---|---|---|---|
directory |
- | 图片所在目录路径(必填) | - |
--delimiter |
-d |
文件名分隔符 | _ |
--position |
-p |
提取位置(0开始) | 1 |
--extensions |
-e |
图片扩展名列表 | .jpg .jpeg .png .gif .bmp .webp .tiff .tif |
--output |
-o |
输出文件路径 | stdout |
--sort |
- | 对结果排序 | False |
--unique |
- | 去重 | False |
提取规则示例
假设分隔符为 _,位置为 1:
| 文件名 | 提取结果 |
|---|---|
BIN245_515194318_0128N.jpg |
515194318 |
abc_def_ghi.png |
def |
2024_0307_event.jpg |
0307 |
product_SKU123_detail.jpg |
SKU123 |
输出格式
515194318,515196709,515270355
注意:2个文件格式不符:invalid_file.jpg, no_underscore.png
使用场景
- 图片处理:从
SKU_12345_variant.jpg中提取 SKU 编号 - 照片管理:从
2024_0307_event.jpg中提取日期 - 批量重命名辅助:提取现有文件名中的关键信息
- 数据整理:从规范化命名的图片中提取ID进行数据库比对
脚本路径
scripts/extract_pic_text.py
在 skill 目录下可直接执行:
python3 ~/.openclaw/workspace/skills/extract-pic-text/scripts/extract_pic_text.py /path/to/images
Usage Guidance
This skill appears to do exactly what it claims: parse image filenames locally using Python 3. Before installing or running it, ensure you have Python 3 available and that you run it on directories you trust (the script will read the directory and can write to any output path you specify). If you are concerned, inspect scripts/extract_pic_text.py yourself — it contains no network calls or credential usage. Also be aware the script only filters by file extension and delimiter/position, so verify the delimiter and position options match your filename conventions and that you provide an output path if you want to save results (it will overwrite the specified output file if it exists).
Capability Analysis
Type: OpenClaw Skill
Name: extract-pic-text
Version: 1.0.0
The skill is a utility for extracting text from image filenames based on user-defined delimiters and positions. The Python script (scripts/extract_pic_text.py) uses standard libraries to process files in a specified directory and lacks any indicators of data exfiltration, malicious execution, or persistence.
Capability Assessment
Purpose & Capability
Name/description match the provided script and runtime instructions. The script implements filename parsing with delimiters/position, extension filtering, sorting, deduplication, and optional output — all consistent with the stated purpose.
Instruction Scope
SKILL.md instructs running the included Python script against a user-specified directory. The runtime instructions reference only the script, local file paths, and standard CLI options. The instructions do not direct reading unrelated system files, environment variables, or outbound network calls.
Install Mechanism
There is no install spec (instruction-only). A single small Python script is included; nothing is downloaded from external sources or written to system locations during install.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The script only needs read access to the target directory and optional write access if the user specifies an output file — this is proportionate to its function.
Persistence & Privilege
The skill is not always-enabled and uses normal model invocation defaults. It does not modify other skills or system configuration and does not request elevated persistence.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install extract-pic-text - After installation, invoke the skill by name or use
/extract-pic-text - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of extract-pic-text.
- Extracts specified text positions from image file names with customizable delimiters.
- Supports batch processing of images in a directory and multiple image formats.
- Allows sorting, duplicate removal, and output to file or stdout.
- Ideal for extracting IDs, numbers, dates, or other structured data from standardized file names.
Metadata
Frequently Asked Questions
What is Extract Pic Text?
Extract specified-position text from image filenames using custom delimiters, supporting batch processing, sorting, deduplication, and multiple image formats. It is an AI Agent Skill for Claude Code / OpenClaw, with 263 downloads so far.
How do I install Extract Pic Text?
Run "/install extract-pic-text" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Extract Pic Text free?
Yes, Extract Pic Text is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Extract Pic Text support?
Extract Pic Text is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Extract Pic Text?
It is built and maintained by Llyouc (@llyouc); the current version is v1.0.0.
More Skills