I have written a script to read file A and for each line return the characters before the first comma and set this to string1 and then search file B for lines that start with string1 and then write any lines found to File3 before moving on to read the second line of file A to start over but I can't get it to work correctly as it seems to only work for the first line read in step one and I don't know why.
Any help much appreciated.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objF1 = objFSO.OpenTextFile(strFile1,1,0)
Set objF2 = objFSO.OpenTextFile(strFile2,1,0)
Set objF3 = objFSO.CreateTextFile(strFile3)
Set objF3 = objFSO.OpenTextFile(strFile3,2)
Do Until objF1.AtEndOfStream
strLine1 = objF1.ReadLine
Length = inStr(strLine1, ",")
strName = Left(strLine1,Length)
Do Until objF2.AtEndOfStream
strLine2 = objF2.ReadLine
If inStr(strLine2, strName) = 1 Then