in reply to Loop through 2 files in parallel
could be one solution. If it was me however, I would probably read the smaller file into an array or another structure and just go through the other one, instead of reading lines from the second loop as many times as the amount of lines the first one has.while ($line_f1 = <FILE>) { while($line_f2 = <FILE2>) { # I'm sure the rest you can do it } seek(FILE2,0,0); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Loop through 2 files in parallel
by sherab (Scribe) on Nov 10, 2010 at 20:11 UTC | |
by rwitmer (Initiate) on Nov 10, 2010 at 21:03 UTC |