|this might work, i haven't tried it yet. two files are required however, even though it is just testing one file, if you want to test each line of the file against the rest of the file. be sure to test it on dummy files in dummy directory so nothing important gets destroyed.|
Const ForReading = 1, ForWriting = 2
Dim fso, txtFile1, txtFile2, strLine1, strLine2, strMatch
Set fso = CreateObject("Scripting.FileSystemObject")
'first copy file to temp because it gets destroyed
do while N>0
Set txtFile2 = fso.OpenTextFile("temp2", ForWriting)
strMatch = False
Do Until txtFile1.AtEndOfStream
if N=0 then
strLine1 = txtFile1.Readline
strLine2 = txtFile1.Readline
If Trim(UCase(strLine2)) = Trim(UCase(strLine1)) Then
strMatch = True
If strMatch <> False then
Wscript.Echo strLine1&" occurs "&N&" times"
if N>0 then
fso.Copyfile "temp2", "temp1"
might be buggy, like i said i haven't tested it.