回复 3# wh1234567 - @echo off
- :: gawk下载:http://www.bathome.net/s/tool/index.html?down&key=gawk
- :: 删除每行中“唯一”两个自定义“关键词”中间的内容。
- set "fs1=次----" ||@rem 开头关键词
- set "fs2==" ||@rem 尾部关键词
- set "a=1.txt"&set "b=2.txt"
- gawk -F"%fs1%" "NF>0{OFS=\"\";print $1,FS,\"%fs2%\",$2,$NF}" "%a%"|gawk -F"%fs2%" "{OFS=\"\";print $1 \"%fs2%\" $NF}" >"%b%"
- %b%
- pause
复制代码
|