楼主需求:设有一旧邮箱地址库a.txt,里面纯英文,每个地址不含空格,每个地址间用空格间隔;有一新邮箱地址库b.txt,每个地址什么字符都有(包含空格),也用空格间隔开,需要用程序删除b.txt中的含有a.txt中的地址。
dim newEmail as string,oldEmail as string,b() as string,i as integer
open "a.txt" for input as #1
input#1 oldEmail
close #1
open "b.txt" for input as #1
input#1 newEmail
close #1
'把新旧地址库读入字符串变量中
b=split(oldEmail," ") '以空格分割旧地址到数组b中
for i=0 to ubound(b)
if trim(b(i))<>"" then newEmail=replace (newEmail,b(i),"") '用空字符替换新地址中所有包含旧地址的字符串
next
open "c.txt" for output as #1
output#1 newEmail
close#1
'写入处理后的地址库到文件c.txt中
[
本帖最后由 lowxiong 于 2012-1-31 16:14 编辑 ]