← 返回 Skills 市场
258
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install j
功能描述
Short alias skill for joining, merging, or combining files, data, or strings. Use when you need to concatenate or merge content from multiple sources.
使用说明 (SKILL.md)
j(Join 简写)
这是一个快速"合并" Skill,用字母 j 触发。用于拼接文件、合并数据、连接字符串,让分散的内容重新组合。
适用场景
当你说:
- "合并这两个文件"
- "把多行合并成一行"
- "join these csv files"
- "concatenate files"
- "combine strings"
- "merge JSON files"
文件合并
cat(拼接)
cat file1.txt file2.txt > combined.txt # 合并两个文件
cat *.log > all.log # 合并所有log
cat part* > full.txt # 合并part开头的文件
paste(列合并)
paste file1.txt file2.txt # 按列合并
paste -d ',' file1.txt file2.txt # 指定分隔符
paste -s file.txt # 行转列(单行输出)
awk高级合并
awk 'FNR==NR{a[$1]=$2;next}{print $0,a[$1]}' file1 file2 # 基于字段合并
join file1 file2 # 基于共同字段连接(需排序)
join -t $' ' -1 1 -2 1 file1 file2 # 指定分隔符和字段
文本合并
行转列
# 多行变单行(空格分隔)
cat file.txt | tr '\
' ' '
# 逗号分隔
paste -sd ',' file.txt
# 不同分隔符
sed ':a;N;$!ba;s/\
/ /g' file.txt
去重合并
cat file1.txt file2.txt | sort | uniq > merged.txt
cat file*.txt | sort -u > unique.txt
JSON合并
jq工具
# 合并两个JSON数组
jq -s 'add' file1.json file2.json
# 合并对象(深合并)
jq -s 'reduce .[] as $item ({}; . * $item)' file1.json file2.json
# 合并数组到对象(按key)
jq -s 'from_entries' file1.json file2.json
Node.js脚本
// merge.js
const fs = require('fs');
const files = process.argv.slice(2);
const result = files.map(f => JSON.parse(fs.readFileSync(f, 'utf8')));
console.log(JSON.stringify(result, null, 2));
node merge.js file1.json file2.json
CSV/TSV处理
# 合并CSV(跳过header)
tail -q -n +2 file1.csv file2.csv > combined.csv
# 垂直合并(相同列结构)
csvstack file1.csv file2.csv > merged.csv
# 水平合并(相同行数)
csvjoin -c id file1.csv file2.csv > merged.csv
代码文件合并
# 合并多个JS文件(加注释分隔)
for f in *.js; do echo "// === $f ===" >> bundle.js; cat "$f" >> bundle.js; done
# 压缩合并(去除空行和注释)
cat *.js | sed '/^\s*\/\//d' | sed '/^\s*$/d' > bundle.min.js
# 按字母顺序
ls *.js | sort | xargs cat > bundle.js
URL/参数合并
bash参数处理
# 合并数组
array=($(cat list.txt))
merged="${array[@]}"
# 合并多行参数
params=$(cat params.txt | tr '\
' '&')
构建请求体
# 合并JSON参数
jq -n --arg a "$(cat a.json)" --arg b "$(cat b.json)" '{a:$a, b:$b}'
技巧与陷阱
保持顺序
# 按文件名顺序合并
ls -1v *.txt | xargs cat > merged.txt # -v: 自然排序
大文件处理
# 流式合并(内存友好)
cat large1.txt large2.txt | gzip > merged.gz
编码问题
# 统一编码为UTF-8
iconv -f GBK -t UTF-8 file.txt > file_utf8.txt
cat *.txt | iconv -f GBK -t UTF-8 > merged.txt
实用单行
# 合并所有Markdown为PDF(需pandoc)
pandoc *.md -o combined.md
# 合并日志并按时间排序(按文件名)
ls -t *.log | xargs cat > chrono.log
# 合并并统计总行数
cat *.txt | wc -l
j 技能帮你无缝衔接碎片化的内容。记住:合并前先备份,合并后做验证!
安全使用建议
This skill is a documentation/cheatsheet for merging files and strings — it does not install anything or ask for secrets. Before using it, ensure: (1) you run the shown commands only on files you intend to merge (they will read and potentially overwrite output files), (2) backup originals before bulk operations, (3) required external tools (jq, csvstack/csvjoin, pandoc, node, iconv) are present on your system if you plan to use those examples, and (4) be cautious about running example scripts on untrusted files (the Node example reads and parses JSON). If you need the agent to operate autonomously, confirm it has explicit, limited file access so it cannot read sensitive files by accident.
功能分析
Type: OpenClaw Skill
Name: j
Version: 1.0.0
The 'j' skill bundle is a collection of standard command-line snippets and instructions for merging files, strings, and data formats like JSON and CSV. It provides legitimate usage examples for common utilities such as cat, awk, jq, and sed, as well as a simple Node.js script for JSON merging. No malicious intent, data exfiltration, or suspicious obfuscation was found in SKILL.md or _meta.json.
能力评估
Purpose & Capability
The name and description (join/merge/concatenate) match the SKILL.md content: examples show cat, paste, join, jq, simple Node script, csv tools, pandoc, iconv, etc. Nothing requested or described suggests capabilities beyond file/data merging.
Instruction Scope
The instructions explicitly tell the agent to read and concatenate local files and run local commands (cat, paste, awk, jq, node, etc.), which is expected for this purpose. This does mean the agent will read any files you ask it to merge and may run a Node script example; the doc does not instruct access to unrelated system paths or external endpoints.
Install Mechanism
No install spec (instruction-only), so nothing is written to disk by the skill itself — lowest install risk. Note: the examples reference external tools (jq, csvstack/csvjoin, pandoc, iconv, node) that are not installed by the skill; the agent environment must already have them available to run those commands.
Credentials
The skill requires no environment variables, credentials, or config paths. There are no unexplained secret requests or access to unrelated services.
Persistence & Privilege
always is false and the skill has no install/persistence behavior. It does not request elevated or permanent presence in the agent environment.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install j - 安装完成后,直接呼叫该 Skill 的名称或使用
/j触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the **j** skill for quickly joining, merging, or combining files, data, or strings.
- Provides concise command examples covering file, text, JSON, CSV/TSV, code files, and URL/parameter merging.
- Includes practical tips on sorting, deduplication, encoding, and handling large files.
- Offers advanced techniques with common CLI tools (cat, paste, awk, jq, etc.) for robust merging operations.
- Skill guide features clear usage scenarios and best practices for safe and efficient content merging.
元数据
常见问题
J 是什么?
Short alias skill for joining, merging, or combining files, data, or strings. Use when you need to concatenate or merge content from multiple sources. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 258 次。
如何安装 J?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install j」即可一键安装,无需额外配置。
J 是免费的吗?
是的,J 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
J 支持哪些平台?
J 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 J?
由 openlang(@openlang-cn)开发并维护,当前版本 v1.0.0。
推荐 Skills