txt替换高手来下..这里面的文字怎么替换!!?

来源:百度知道 编辑:UC知道 时间:2024/05/24 16:15:21


<br>001

替换成

tips[01] = 《

并且每行后面加上

》;

应该怎么替换???
<br>002
替换成
tips[02] = 《
并且每行后面加上
》;

<br>003
替换成
tips[03] = 《
并且每行后面加上
》;

像这样递增的,,有1000多条

循环使用

replace 函数

直至 结束~

不用高手,用Replace Pioneer 2.2, 并结合正则表达式,极简单:

1. ctrl-o打开待替换的文本文件
2. ctrl-h打开Replace窗口
在search for pattern下面输入(不包含双引号):
"<br>(\d+)(.*?)\n"
在replace with pattern输入(不包含双引号):
"tips[\1] = 《\2》;\n"
3. 点击Replace,即可完成。

Replace Pioneer下载:
http://www.mind-pioneer.com/replace

给你写个函数,自己注意下查找文字和替换文字的空格
function th(zf as string) as string
if replace(zf,"<br>001","tips[01] = 《 ") <> zf then
th=replace(zf,"<br>001","tips[01] = 《 ")
elseif replace(zf,"<br>002","tips[02] = 《 ") <> zf then
th=replace(zf,"<br>002","tips[02] = 《 ")
elseif replace(zf,"<br>003","tips[03] = 《 ") <&g