When you do things right, people won't be sure you've done anything at all.
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.
When you do things right, people won't be sure you've done anything at all.
When you do things right, people won't be sure you've done anything at all.
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.
When you do things right, people won't be sure you've done anything at all.
When you do things right, people won't be sure you've done anything at all.
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?
When you do things right, people won't be sure you've done anything at all.
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.
When you do things right, people won't be sure you've done anything at all.