Campbell Ritchie wrote:Don't know any VB, I am afraid.
Write out with pencil and paper what will happen with your loops. I suspect your nested loops are reading the first line of file 1, then the whole of file 2, then the second line of file 1, etc. Verify your loop by putting some print statements into it.
Janeice DelVecchio wrote:Logic should be this:
Read first line from file 1.
compare to all lines in file 2
if it's there, skip.
if not, write the line to output
Continue with the remaining lines of file 1.
write output to the required file if there's anything in it,
write nothing if output is empty.
Paul Clapham wrote:You're still only reading isFile once (for the first record of shouldBe) and not once for every record of shouldBe. All of the code in the inner do-while is only executed for the first record of shouldBe. But I've said this before, am I wrong?
Janeice DelVecchio wrote:Or maybe you're saying that the inner loop only happens once.... doesn't it start over on the next outer loop?
Paul Clapham wrote: but after the first time through the outer loop, the file you're reading in the inner loop is at end-of-file, so executing the inner loop does nothing.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton