baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
hi
a very basic question. how to read two files at the same time. Example:
since the files are too large and i have not enough memory to store my files i am forced to do something like this but i hav realized that i don't know how to do this. If i have two nested while loops like this:file a file b 1 read a line from a 2 read a line from b 3 read a line from a 4 read a line from b ...
how do i continue from where i stopped in the nested loop? Thank youwhile(<F1>){ #read a line while(<F2>){ #read a line last; # go back to the main loop, but how to continue from this p +oint in the next iteration ? } }
baxy
UPDATE: Thnx moritz ! that did it :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: reading two files in parallel
by moritz (Cardinal) on May 02, 2013 at 10:17 UTC | |
by morgon (Priest) on May 02, 2013 at 14:49 UTC | |
Re: reading two files in parallel
by Laurent_R (Canon) on May 02, 2013 at 11:57 UTC | |
Re: reading two files in parallel
by LanX (Saint) on May 02, 2013 at 19:32 UTC | |
by Laurent_R (Canon) on May 02, 2013 at 22:06 UTC | |
Re: reading two files in parallel
by sundialsvc4 (Abbot) on May 02, 2013 at 12:36 UTC | |
by moritz (Cardinal) on May 02, 2013 at 19:12 UTC | |
by karlgoethebier (Abbot) on May 02, 2013 at 17:48 UTC | |
by Laurent_R (Canon) on May 02, 2013 at 18:55 UTC | |
by Anonymous Monk on May 02, 2013 at 23:45 UTC |
Back to
Seekers of Perl Wisdom