SPUG: DBD::CSV Problems
creede at penguinsinthenight.com
Tue Apr 12 20:56:40 PDT 2005
I will admit to never having used DBI::CSV, but I notice that your
connect string is
my $dbh = DBI->connect("DBI:CSV:f_dir=/home/jc/data/yahoo.csv");
and your error message is
No such directory '/home/jc/data/yahoo.csv' at ./dbtest.pl line 27
so I'm just guessing here that you're using the wrong method to
specify the file you want to open. A quick look at Google indicates that
you do indeed need to specify a directory as the argument to f_dir,
but I didn't google far enough to find out how to specify the file.
On Tue, Apr 12, 2005 at 08:06:20PM -0700, 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.
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 4/12/2005
> Seattle Perl Users Group Mailing List
> POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
> MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med
> WEB PAGE: http://seattleperl.org/
* .~. ( : Creede Lambard :
Never rush a miracle man. . / V \ . :------------------------:
You get lousy miracles. /( )\ : creede at :
--------------------------------^^-^^----: penguinsinthenight :
Linux. Reliable and free. Pick any two. : dot com :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20050412/68e4d932/attachment.bin
More information about the spug-list