in reply to Re: DBD::CSV and really bad legacy flat file
in thread DBD::CSV and really bad legacy flat file

That fails because parsing CSV-style data is more difficult than it appears. The first hurdle is how to handle when the separator appears in a quoted field ("joe _blow" _ 2 _ "hourly"). The second hurdle is more fiendish: newlines embedded in quoted fields. It's less likely to occur, but if it does, iterating over records becomes painful.

Cheers,
Ovid

New address of my CGI Course.

  • Comment on Re^2: DBD::CSV and really bad legacy flat file

Replies are listed 'Best First'.
Re^3: DBD::CSV and really bad legacy flat file
by greenFox (Vicar) on Jul 19, 2005 at 07:27 UTC

    I hadn't considered newlines but the separator sounded like it would be unique enough in this instance, the original poster described it as "space underscore space with _UNSC being the escape string"... which I admit isn't entirely clear to me and why I suggested the OP post some sample data, I just took the liberty of simplifying it to "_ " for my example, my bad! :-)

    --
    Murray Barton
    Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho