vb 批量替换

来源:百度知道 编辑:UC知道 时间:2024/06/03 22:58:59
ell@pku.edu.cn
epku@chinese.pku.edu.cn
zhwanhe@hotmail.com
guorui@pku.edu.cn
chao.ding@263.net
dingjizhinan@sina.com
hellohellohello@263.net
songwwei101@sina.com
kpole21@263.com
cqcaiyan@263.net
yongxinqun@eyou.com
zhangweimin1990@263.net
xiaxizhou@263.net
lishibiao66@263.net

有大量数据需要替换,将“@”替换为:@,将“.”替换成".",求VB算法比较快的算法,谢谢

用循环加replace函数。假如这是在一个文件中,
open "c:\1.txt" for input as #1
open "c:\2.txt" for output as #2
do while not eof(1)
line input #1,r
r=replace(r,"@",".")
print #2,r
loop
close

比如你的全部邮箱在text1.text中
把所有的"@"换成"@."
text1=Replace(text1,"@","@.")

关注…