I want to read two files, compare the first line of the first file with the first line of the second and then the second of the second and so on, when I hit the end of the second file I move to the second line of the first and carry on again. If at the end of the first pass the line in the first file does not exist in the second then write it out to a third file.
Confusing hey!!
here is where I got to with the code
Set objReader = FSO.OpenTextFile(OutFile)
Set objReader2 = FSO.OpenTextFile(TempFile)
Set objWriter = FSO.OpenTextFile(FinalFile,ForAppending)
Do While not objReader.AtEndOfStream
strline = objReader.ReadLine
Do While not objReader2.AtEndOfStream strline2 = objReader2.Readline
If StrComp(strline,strline2,vbTextCompare) = -1 Or StrComp(strline,strline2,vbTextCompare) = 1 Then
what do I put in here
End If
Loop
objWriter.WriteLine(strline)
now I now that I have got my write in the wrong place as if the last line of the second file does not compare it will write out to the third file regardles of all the other looped checks.
Is there another way of checking for the existance of something within a file without reading in each line, IE some sort of scan of the file.
Thanks
Steve
HELP!!!
I hope this makes sence
Regards
Steve
Confusing hey!!
here is where I got to with the code
Set objReader = FSO.OpenTextFile(OutFile)
Set objReader2 = FSO.OpenTextFile(TempFile)
Set objWriter = FSO.OpenTextFile(FinalFile,ForAppending)
Do While not objReader.AtEndOfStream
strline = objReader.ReadLine
Do While not objReader2.AtEndOfStream strline2 = objReader2.Readline
If StrComp(strline,strline2,vbTextCompare) = -1 Or StrComp(strline,strline2,vbTextCompare) = 1 Then
what do I put in here
End If
Loop
objWriter.WriteLine(strline)
now I now that I have got my write in the wrong place as if the last line of the second file does not compare it will write out to the third file regardles of all the other looped checks.
Is there another way of checking for the existance of something within a file without reading in each line, IE some sort of scan of the file.
Thanks
Steve
HELP!!!
I hope this makes sence
Regards
Steve