in reply to Re: file parsing help
in thread file parsing help

Good catch on the Also, something's fishy about
if ($id eq "") { $id=sprintf("%-*s",8,$prev_id); } else { $id=sprintf("%-*s",8,$prev_id); }
This fixed the problem I had with the holes in the fourth field.
I have also changed the variables names away from $a and $b.

I am still getting missing values for the SIC code in the second field, after adding in the trim($index) eq '' ...

I appreciate the feedback thus far.

Replies are listed 'Best First'.
Re^3: file parsing help
by ikegami (Patriarch) on Nov 13, 2006 at 17:35 UTC

    Also, something's fishy about

    This fixed the problem I had with the holes in the fourth field.

    The "then" and "else" part are identical.

    if ($id eq "") { $id=sprintf("%-*s",8,$prev_id); } else { $id=sprintf("%-*s",8,$prev_id); }

    is the same thing as

    $id=sprintf("%-*s",8,$prev_id);

    I am still getting missing values for the SIC code in the second field

    The problem occurs for the first record of every employee except the first employee. That should be easy to debug.