in reply to Parsing CSV only returns the second line of the file
Hello saint_geser, and welcome to the Monastery!
In addition to the modulus problem highlighted by Anonymous Monk, above (and ignoring the fact that the code snippet you gave doesn’t compile!), there is a problem with the following line:
open (TEMP, '>', $temp) or die Lava::Message("Can't open temporary fil +e");
This occurs within the outer while loop, so on each iteration, whenever the if condition succeeds, the temp file is truncated (“clobbered,” erased) as it is re-opened for output. See open.
Move the open statement to before the loop, so it is executed only once.
Hope that helps,
Athanasius <°(((>< contra mundum
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing CSV only returns the second line of the file
by saint_geser (Initiate) on Sep 01, 2012 at 09:54 UTC | |
by Athanasius (Archbishop) on Sep 01, 2012 at 10:19 UTC |