SPUG: DBD::CSV Problems

Dan Ebert mathin at mathin.com
Tue Apr 12 20:48:33 PDT 2005


You might try Text::CSV (available on CPAN).  I've used it before and 
it's pretty good.

Dan.

Jim Clark wrote:

>Hi All,
>  I feel a brief history is in order before I get to 
>my problem.  
>
>I retired in 2002 and have not cut a line of production
>code since July of that year.  A former co-worker asked me
>to crunch some data for the small business he started.  Being
>out of the workforce for a while, I'm definitely not
>up to date with perl so I may ask stupid questions.
>
>That being said, here is my problem.
>
>I have some .csv files I need to read, parse and 
>write.  I planned on using DBI/DBD.  I have been 
>unable to open the csv files with a connect.  
>I have a lot of experience with DBD::Oracle
>but am at an empass with DBD::CSV.  I'm not looking
>forward to writing code to parse a csv file.
>
>Here is where I'm at...
>
>OS RH 9.2
>Perl 5.8.0
>DBI/DBD drivers installed within the last month
>SQL::Statement is installed
>Text::CSV_XS is installed
>
>Here is the connect sub...
>
>sub connect_to_yahoo
>{
>
>  my $dbh = DBI->connect( "DBI:CSV:f_dir=/home/jc/data/yahoo.csv" ) ;
>
>  return  ( $DBI::err ? 0 : $dbh ) ;
>
>}
>
>and the error message
>
>No such directory '/home/jc/data/yahoo.csv' at ./dbtest.pl line 27
>
>The directory and the file definitely exist.  
>
>Any help would be greatly apprecieated.
>
>Thanks,
>
>JC
>
>
>
>
>
>  
>



More information about the spug-list mailing list