All,
I have a text file that has 100rds of email addresses, I need to write a VBscript file that will find if any matches exist and then delete any duplicates. I copy the original file to a second file so that I can verify howmany times the address appears.
I have so far done
Set rexp = New RegExp
rexp.Global = True
Set objWriter = FSO.OpenTextFile(Agency,8,Create)
Do While not objReader.AtEndOfStream
strline = objReader.ReadLine
rexp.Pattern = strline
Do While not objReader3.AtEndOfStream
strline3 = objReader3.ReadAll
Set mtchs = rexp.Execute(strline3)
If mtchs.count = 1 then
Do While not objReader2.AtEndOfStream
strline2 = objReader2.ReadAll
Set mtchs = rexp.Execute(strline2)
If mtchs.count = 0 then
objWriter.WriteLine(strline)
End If
I am writing out to a file If no matches exist so that I have a clean copy. How do I do a single write if multiple's exist. At present it will not write anything if the match is greater than 1.
Regards
Steve
I have a text file that has 100rds of email addresses, I need to write a VBscript file that will find if any matches exist and then delete any duplicates. I copy the original file to a second file so that I can verify howmany times the address appears.
I have so far done
Set rexp = New RegExp
rexp.Global = True
Set objWriter = FSO.OpenTextFile(Agency,8,Create)
Do While not objReader.AtEndOfStream
strline = objReader.ReadLine
rexp.Pattern = strline
Do While not objReader3.AtEndOfStream
strline3 = objReader3.ReadAll
Set mtchs = rexp.Execute(strline3)
If mtchs.count = 1 then
Do While not objReader2.AtEndOfStream
strline2 = objReader2.ReadAll
Set mtchs = rexp.Execute(strline2)
If mtchs.count = 0 then
objWriter.WriteLine(strline)
End If
I am writing out to a file If no matches exist so that I have a clean copy. How do I do a single write if multiple's exist. At present it will not write anything if the match is greater than 1.
Regards
Steve