Replace Pioneer软件介绍
展开
编辑本段软件介绍
Replace Pioneer[1] 是Mind Pioneer出品的一款共享软件。
Replace Pioneer是一款与众不同的专业文本批量替换和处理软件。
它的强大可以简单概括为:给定任何纯文本文件,二进制文件甚至网页地址,只要你能描述清楚转换规则,就能得到任何需要的结果文件。
虽然Replace Pioneer主要是一个文本替换工具,但是它衍生出来的功能几乎覆盖了纯文本处理的任何一个角落,而且在任一领域,它都有独到之处:
* 作为批量文本替换软件
–支持最基本的多行文本,多文件,正则表达式替换
–可在指定特征和序号的段/行的范围内,替换指定特征和序号的字/词/行/段;
–可自定义段/词的分隔符;
–对搜索到的文字可以进行任意切割重组,加序号,或运用内置的或自定义的函数;
–对搜索到的的文字可以进行添加自定义过滤条件或运行自定义代码;
–支持在文件首尾加文字;
–支持把多步替换记录为脚本并重用;
–支持以DOS命令或网页作为输入文本进行操作;
–支持由以上功能衍生出来的文本排序/提取/计算/统计/格式转换/翻译/HTML和TXT互转/进制转换器/IP转换成国家等等功能。
–支持对二进制文件的字节进行搜索替换和运用函数
* 作为批量文本分割合并工具
–支持按指定可变行数/字数/自定义段分割;
–支持按自定义列横向分割文件;
–支持按文件首行等灵活规则命名分割文件;
–支持按列横向合并文件;
–支持分割和合并的同时进行文本替换和处理。
* 作为批量文本编码转换工具
–可支持包括unicode在内的任意70多种编码方式之间的批量转换;
–支持独特的编码检测功能可以有效地帮助用户确定文件的编码方式。
* 作为批量文件重命名工具
–支持按文件名,时间,目录等进行任意排序;
–支持文件名任意切割和重组;
–支持文件名加长度可控的序号;
–支持对文件名进行正则替换,甚至运行函数;
–支持用文件首行,html文件的标题,文件时间,目录等等对文件进行重命名。
* 作为批量下载工具
–支持对批量网页进行下载地址解析和名字过滤;
–支持第二级可过滤网页链接解析
–支持保存文件时直接进行灵活的重命名;
–文件可以下载保存为html,text(文本),binary(二进制),甚至Links(链接)。
在不牺牲强大功能的前提下,它努力做到了简单,灵活和专业的高度统一。你甚至可以把以上所有功能同时设置,处理文本一气呵成。
编辑本段不足之处
1. 为保持界面的高度统一和简洁,很多衍生出来的高级功能对初学者不是很直观易懂,为弥补这一不足,系统提供了100个以上的支持不同功能的模板,而且在主站上有数百个不同的例子供参考。正如初学陀螺的人可能很难很好地驾驭它,等到能灵活控制后就会为它的简单和完美而陶醉。
2. 高度灵活和面面俱到的功能不可避免地带来了速度上的延迟,就像航空母舰不可能以F1赛车的速度启航。新提供的批量Fast Replace功能弥补了这一不足。
3. 目前只有英文版,但由于对多种编码的支持,处理中文文档完全没有问题。然而很多人可能会对英文版望而却步,其实很简单,这其实是一个熟悉计算机英语基本词汇的很好的机会。
编辑本段使用技巧
* 批量替换
如何定义多个替换规则,对多个文本进行批量替换,比如,把很多文件里的a1,a2,a3,…分别替换成b1,b2,b3,…的详细步骤:
1. 打开Tools->Batch Runner菜单
2. 把文件从Windows 文件管理器拖拽到Batch Runner菜单中
3. 点击Fast Replace,打开Fast Replace窗口
4. 点击Add键,在Search输入a1,在Replace输入b1,点击OK
5. 重复第4步,直到所有的替换规则a2,b2;a3,b3…都加入
6. 点击export就可以把规则输出到一个文件,下次点击import可以把规则导入
7. 点击start即可。
注意:
1. 要提前备份
2. 如果替换的文字有特殊字符比如$.\等等,要把Regular Exp选项去掉
* 批量转换文件编码方式
以ansi(gbk)->UTF8为例来说明。
用Replace Pioneer批量把ansi(gbk)格式的文本文件转换为UTF8的方法如下:
第一步:选文件
1.打开Tools->Batch Runner菜单
2.把待处理文件从Windows拖拽到Batch Runner窗口中
第二步:变换编码
1.点击Change Encode按钮
2.点击input encoding,设置成CN->gbk
3.点击output encoding,设置成utf-8
4.点击start,完成
如何用Replace Pioneer检测出一个文件是什么编码:
1. 选择Tools->Encoding Detection
2. 在”File to Check”里输入文件名,点击Start
3. 文件就会被用70多种编码方式显示出来
哪一个显示正确就可能是这种编码,当然,某个文件可能在多种编码方式下都显示正确。
* 自动分割文本文件
Replace Pioneer可以按章/节/回,等等任意自定义的文字进行分割。
如果需要,也可以按行数和字数进行分割。
按章/节/回分割的具体步骤:
1. ctrl-o打开待分割的txt文件
2. 选择File->Save As->Split by Paragraph菜单:
* 输出格式设置
在Split Naming输入${BASE}.###.${EXT}
* 怎样分段
把Para Start选项选成Other,并在右边输入”^\s*第.*?[章节回]”(不带双引号)
把Para End选为None,表示只按照para start的内容分段。
* 写入文件
点击Next,并输入结果文件名比如A.TXT,那么结果文件就被写成A.001.TXT, A.002.TXT, …
更多用法:
1. 要想加入其他类型比如”篇”,只要把”篇”加入上面Para Start的方括号,变成”^\s*第.*?[章节回篇]”(不带双引号)
2. 如果每章的格式是1.xxx 2.xxx …,只要把Para Start变成”^\s*\d+\.”(不带双引号)[1]
3. 如果每章的格式是 一、xxx 二、xxx …,只要把Para Start变成”^\s*[一二三四五六七八九零〇百千]+、”(不带双引号)
4. 要想按行数/字数分段,就用File->Save As->Split by bytes/lines菜单。
* 文件重命名
用Replace Pioneer实现66 种批量文件重命名的方法
详细步骤:
1. 安装并打开 “Replace Pioneer” ,打开 “Tools->Batch Runner” 菜单。
2. 把所有Window文件拖拽到”Batch Runner”窗口中。
3. 把”Set output filename”选项改为用户需要的重命名公式。
4. 点击File Rename按钮完成。
编号 | 改文件名后缀 | 原文件名实例 | 新文件名实例 | 公式 |
1 | change extension | file.txt | file.new | ${BASE}.new |
2 | insert before extension | file.txt | file.new.txt | ${BASE}.new.${EXT} |
3 | add new extension | file | file.new | ${FILENAME}.new |
文件名重新组织 | 原文件名实例 | 新文件名实例 | 公式 | |
4 | take first 3 chars | abc1234.txt | abc.txt | ${BASE}{1,3}.${EXT} |
5 | take last 3 chars | 1234abc.txt | abc.txt | ${BASE}{-3,-1}.${EXT} |
6 | take 3 ~ 6 chars | ab1234c.txt | 1234.txt | ${BASE}{3,6}.${EXT} |
7 | take 1 ~ -3(3rd from end) chars | abcde12.txt | abcde.txt | ${BASE}{1,-3}.${EXT} |
8 | take 3 ~ -3(3rd from end) chars | ab1234cd.txt | 1234.txt | ${BASE}{3,-3}.${EXT} |
9 | first 3 and from the 8th char on | abc1234def.txt | abcdef.txt | ${BASE}{1,3}${BASE}{8,-1}.${EXT} |
10 | exchange 1,2 and 3,4 chars | abcd.txt | cdab.txt | ${BASE}{3,4}_${BASE}{1,2}.${EXT} |
文件名加序号 | 原文件名实例 | 新文件名实例 | 公式 | |
11 | sequence number of 1,2,3 … | any.txt | N.txt(N=1,2, …) | #.${EXT} |
12 | sequence number of 0001,0002,0003 … | any.txt | N.txt(N=0001,0002,…) | ####.${EXT} |
13 | sequence number of 3,4,5,… | any.txt | N.txt(N=3,4, …) | #{3}.${EXT} |
14 | sequence number of 5,7,9,…(start=5,step=2) | any.txt | N.txt(N=5,7,9,…) | #{5,2}.${EXT} |
15 | sequence number of 100,99,98,…(start=100,step=-1) | any.txt | N.txt(N=100,99,98,…) | ###{100,-1}.${EXT} |
16 | add sequence number 001,002,… before filename | file.txt | N_file.txt(N=001,002,…) | ###_${FILENAME} |
17 | append sequence number 001,002,… after filename | file.txt | file_N.txt(N=001,002,…) | ${BASE}_###.${EXT} |
18 | change the extension name to sequence 001,002,… | file.txt | file.N(N=001,002,…) | ${BASE}.### |
19 | append sequence aaa,aab,…zzz to filename | file.txt | file.txt.X(X=aaa,aab,aac,…zzz) | ${FILENAME}.@@@ |
20 | create sequence number of 01_01, 01_02, … 01_10, 02_01, 02_02,… 02_10, 03_01,03_02,… | any.txt | M_N.txt(M:01,02,03,…,N:01~10) | #<calc(($&-1)/10+1,”02″)>_#<calc(($&-1)%10+1,”02″)>${EXT} |
字符串替换和正则表达式 | 原文件名实例 | 新文件名实例 | 公式 | |
21 | replace ‘old’ with ‘new’ in name | old123.txt | new123.txt | ${FILENAME}{replace,’old’,’new’} |
22 | remove any digit in filename | abc123def456.txt | abcdef.txt | ${BASE}{replace,’\d+’,”}.${EXT} |
23 | remove digits that as surfix | abc123def456.txt | abc123def.txt | ${BASE}{replace,’\d+$’,”}.${EXT} |
24 | remove digits that as prefix | 123abc456.txt | abc456.txt | ${BASE}{replace,’^\d+’,”}.${EXT} |
25 | add parenthesis for any number | abc123def456.txt | abc(123)def(456).txt | ${BASE}{replace,'(\d+)’,'(\1)’}.${EXT} |
26 | remove all parenthesis in filename | abc(123).txt | abc123.txt | ${BASE}{replace,’\((.*?)\)’,’\1′}.${EXT} |
27 | change all parenthesis to bracket | abc(123).txt | abc[123].txt | ${BASE}{replace,’\((.*?)\)’,'[\1]’}.${EXT} |
28 | exchange parts before and after dash | abc-def.txt | def-abc.txt | ${BASE}{replace,'(.*?)-(.*)’,’\2-\1′}.${EXT} |
29 | change dash to parenthesis | abc-def.txt | abc(def).txt | ${BASE}{replace,'(.*?)-(.*)’,’\1(\2)’}.${EXT} |
30 | change all spaces to underscore | abc def.txt | abc_def.txt | ${BASE}{replace,’\s+’,’_’}.${EXT} |
根据文件内容来替换文件名 | 原文件名实例 | 新文件名实例 | 公式 | |
31 | change filename to the first word of file content | any.txt | firstword | ${FILENAME}{file_content,'(\S+)’} |
32 | change filename to the first 60 chars of 1st line of file content | any.txt | firstline(60 letter maximum) | ${FIRSTLINE}{1,60} |
33 | change filename to the first 60 chars of 2nd line of file content | any.txt | secondline(60 letter maximum) | ${FILENAME}{file_line,2}{1,60} |
34 | change filename to the title of html file | any.html | htmltitle.html | ${FILENAME}{html_title}{1,20}.html |
35 | change filename to the content between <strong> and </strong> | any.html | strongcontent.html | ###_${FILENAME}{file_content,'<strong>(.*?)<\/strong>’,undef,10000}.${EXT} |
36 | change filename to the content followed by phase_name inside file | any.html | phase_name_content.html | ${FILENAME}{file_content,’phase_name\s*”(.*?)”‘}.${EXT} |
根据文件时间替换文件名 | 原文件名实例 | 新文件名实例 | 公式 | |
37 | change filename to the date time of file | any.jpg | 2010-07-01_18:19:20.jpg | ${FILENAME}{file_time, ‘%Y-%m-%d_%H:%M:%S’}.${EXT} |
38 | change filename to the date of file plus sequence number | any.jpg | 2010-07-01(N).jpg(N=01,02,03,…) | ${FILENAME}{file_time, ‘%Y-%m-%d’}(##).${EXT} |
39 | append file date to original filename | abc.jpg | abc_2010-07-01.jpg | ${BASE}_${FILENAME}{file_time, ‘%Y-%m-%d’}.${EXT} |
根据mp3文件的内容重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
40 | rename mp3 files to artist-album-track format | abc.mp3 | artist-album-track.mp3 | ${FILENAME}{mp3_info,’%R-%A-%T’}.mp3 |
41 | rename mp3 files to artist-album format with sequence number | abc.mp3 | artist-album_N.mp3(N=001,002,…) | ${FILENAME}{mp3_info,’%R-%A’}_###.mp3 |
42 | append artist and album after original filename | abc.mp3 | abc_arrist-album.mp3 | ${BASE}_${FILENAME}{mp3_info,’%R-%A’}.mp3 |
根据图片文件的内容重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
43 | rename jpg files by adding sequence and picture width, height | abc.jpg | N_W_H.jpg(N=001,002,… W=width, H=height) | ###_${FILENAME}<img_info($&,’%W_%H’)>.${EXT} |
44 | rename gif files by appending width and height | abc.gif | abc_WxH.gif(W=width,H=height) | ${BASE}_${FILENAME}<img_info($&,’%Wx%H’)>.${EXT} |
根据索引文件,对照文件来重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
45 | change the Nth filename to the Nth line of indexfile | file.jpg(sequence number=N) | X_(lineN_of_indexfile).jpg(N=file sequence,X=001,002,…) | ###_#<file_line(‘indexfile’,$match)>.${EXT} |
46 | change the filename by looking up the mapping list in mapfile(1) | old.txt | new.txt(old<table>new is defined in mapfile) | ${BASE}<file_content(‘mapfile’,”(?:\n|^)$match\t([^\n]*)”)>.${EXT} |
47 | change the filename by looking up the mapping list in mapfile(2) | old.txt | new.txt(old,new is defined in mapfile) | ${BASE}<file_content(‘mapfile’,”(?:\n|^)$match,([^\n]*)”)>.${EXT} |
根据目录名来重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
48 | add the pathname in the front of filename | c:\test\abc\01.jpg | abc_01.jpg | #<basename(getcwd)>_${FILENAME} |
49 | add the pathname and related sequence no in the front of filename | c:\a\x.jpg, y.jpg c:\b\x.jpg, y.jpg | a_001.jpg, a_002.jpg, b_001.jpg, b_002.jpg | #<sprintf(“%s_%03d”,$A=basename(getcwd),($A eq $B && $match!=1)?++$I:($I=1),$B=$A)>.${EXT} |
50 | create subfolder and move file in it | c:\test\a.txt | c:\test\old\a.txt | #<scalar(system(‘mkdir old’),’old’)>\${FILENAME} |
按照大小写重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
51 | change whole filename to lower case | FILE.TXT | file.txt | ${FILENAME}{lc} |
52 | change whole filename to upper case | file.txt | FILE.TXT | ${FILENAME}{uc} |
53 | change the first letter to upper case | file.txt | File.txt | ${FILENAME}{ucfirst} |
54 | change the first letter of each word to upper case | test file.txt | Test File.txt | ${BASE}{replace,’\b\w’,’\U$&’}.${EXT} |
对数字作运算,改变数字格式 | 原文件名实例 | 新文件名实例 | 公式 | |
55 | change all number in filename to 4 digits format | file123.txt | file0123.txt | ${BASE}<replace($match,'(\d+)’,’${\calc($1,”04d”)}’)>.${EXT} |
56 | add all number in filename by 3, use 4 digits format | file123.txt | file0126.txt | ${BASE}<replace($match,'(\d+)’,’${\calc($1+3,”04d”)}’)>.${EXT} |
57 | multiply all number in filename by 2, use 4 digits format | file123.txt | file0246.txt | ${BASE}<replace($match,'(\d+)’,’${\calc($1*2,”04d”)}’)>.${EXT} |
58 | filename is pure number, add the number by the first number in file content | 123.txt | 133.txt(assume first number in file content is 10) | ${FILENAME}<add(basename($&),file_content($&,'(\d+)’))>.${EXT} |
59 | add leading zeros to make the filename has length of 10 | 12W.txt | 00012W.txt(total length is 10) | ${FILENAME}{calc,’010s’} |
用随机字母和单词重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
60 | append to filename random letters and digit with length of 5 | abc.txt | abc_xxxxx.txt(xxxxx is random letters/digits) | ${BASE}_#<rand_str(5,’a’..’z’,0..9)>.${EXT} |
61 | rename file to random word from candidate words | abc.txt | N_C.txt(N=001,002,…, C=random of ‘RED’, ‘PURPLE’,…) | ###_#<rand_str(1,’RED’,’PURPLE’,’GREEN’,’BLUE’,’ORANGE’)>.${EXT} |
字符映射法重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
62 | change filename by mapping 0-9 to A-J correspondingly | 0123.jpg | ABCD.jpg | ${BASE}<scalar($&=~tr/0-9/A-J/,$&)>.${EXT} |
63 | change filename by mapping 0-4 to 5-9, and 5-9 to 0-4 | 012348888.jpg | 567893333.jpg | ${BASE}<scalar($&=~tr/0-4,5-9/5-9,0-4/,$&)>.${EXT} |
64 | change filename by reverse upper and lower cases | TELLme.txt | tellME.txt | ${BASE}<scalar($&=~tr/A-Za-z/a-zA-Z/,$&)>.${EXT} |
趣味重命名 | 原文件名实例 | 新文件名实例 | 公式 | |
65 | reverse letters of filename | just for fun.txt | nuf rof tsuj.txt | ${BASE}{chars_r,1,-1}.${EXT} |
66 | double each letter in filename | just for fun.txt | jjuusstt ffoorr ffuunn.txt | ${BASE}{replace,'(.)’,’\1\1′}.${EXT} |
Replace Pioneer网址:www.mind-pioneer.com