RE: CSV problem on Solaris
am 28.06.2006 19:55:32 von campbelbA bit OT, but assuming it's a linefeed issue...
UltraEdit does offer linefeed options.
You can convert files using File -> Conversion -> ...
You can tell it whether to load/save in the Unix format using Advanced =
-> Configuration -> General.
-----Original Message-----
From: Garrett, Philip (MAN-Corporate) =
[mailto:Philip.Garrett@manheim.com]=20
Sent: Wednesday, June 28, 2006 7:22 AM
To: dbi-users@perl.org
Cc: Govinda.Pfister@telekom.de
Subject: RE: CSV problem on Solaris
-----Original Message-----
From: Govinda.Pfister@telekom.de [mailto:Govinda.Pfister@telekom.de]=20
Sent: Wednesday, June 28, 2006 9:47 AM
To: Garrett, Philip (MAN-Corporate)
Subject: AW: CSV problem on Solaris
> > > =20
> > > I do have a problem with a littler perl script I wrote. It uses
> > > DBD:CSV and I don=B4t know why it doesn=B4t work as I would =
expect it.
> > >
> > [snip]
> > >
> > > my $dbh =3D DBI->connect("DBI:CSV:");
> >=20
> > Add this after connecting:
> > $dbh->{RaiseError} =3D 1;
> >=20
> > This will cause DBI to die with an error message when there is a
> > problem.
>=20
> 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 =3D DBI->connect("DBI:CSV:csv_eol=3D\012");
Philip