[Pdx-pm] reading a broken CSV file
Jeff Zucker
jeff at vpservices.com
Fri Nov 21 18:32:41 CST 2003
Colin Kuskie wrote:
>Get a line.
>Feed it into some module that handles CSV and returns an array of elements
>
If that module is Text::CSV_XS, then the rest of this is irrelevant
because it handles embedded newlines. But since Eric is dealing with
DBI and a database already, I can't think of any reason that DBD::CSV
isn't the right tool for this job, but I'm prejudiced.
>Do I have enough columns?
>NO: Remove newline from present line;
> Fetch another line from file;
> Append it to the current line and check again.
>YES: Push data into database.
>
Text::CSV_XS and DBD::CSV do all that for you.
--
Jeff
More information about the Pdx-pm-list
mailing list