RE: CSV problem on Solaris



-----Original Message-----
From: Govinda.Pfister@xxxxxxxxxx [mailto:Govinda.Pfister@xxxxxxxxxx]
Sent: Wednesday, June 28, 2006 9:47 AM
To: Garrett, Philip (MAN-Corporate)
Subject: AW: CSV problem on Solaris

I do have a problem with a littler perl script I wrote. It uses
DBD:CSV and I don´t know why it doesn´t work as I would expect it.

[snip]

my $dbh = DBI->connect("DBI:CSV:");

Add this after connecting:
$dbh->{RaiseError} = 1;

This will cause DBI to die with an error message when there is a
problem.

Just inserted. Fired the script again.
The result is the same.

That probably means that you do indeed have a line-ending problem. I
have tested this on Solaris and I have the same problem. The issue is
that the default line ending for DBD::CSV is CR/LF (DOS format), but
(apparently?) UltraEdit uses Unix line endings (LF).

There are a couple of solutions:
* Use unix2dos to convert the CSV file format, or
* Specify line ending in the DBI connect call:
my $dbh = DBI->connect("DBI:CSV:csv_eol=\012");

Philip
.



Relevant Pages

  • RE: CSV problem on Solaris
    ... UltraEdit does offer linefeed options. ... Subject: AW: CSV problem on Solaris ...
    (perl.dbi.users)
  • RE: CSV problem on Solaris
    ... Subject: DBD:CSV problem on Solaris ... I do have a problem with a littler perl script I wrote. ... This will cause DBI to die with an error message when there is a ...
    (perl.dbi.users)