Oops, I forgot to add 'skip_rows' to that last bit.

$dbh->{'csv_tables'}->{my_table} = {
   'eol' => "\n"
   'file' => "my_table.csv",
   'skip_rows' => 0,
   'col_names' => $columnNames
};

It also assumes that the first row of the data file *does not* contain the 
column names. If your file does then leave off the 'skip_rows' and 
'col_names' bits.

Rick

On Thursday 19 July 2001 12:03 pm, you wrote:
> The default value for the eol is '\r\n' which is the EOL in DOS.
>
> You can set up your connection like this:
>
> my $dbh = DBI->connect("DBI:CSV:")
>    or die "Cannot connect to CSV database: $DBI::erstr\n";;
>
> my $columnNames = [
>       qw(
>          Column1
>          Column2
>          Column3
>          Column4
>          Column5
>       )
>    ];
>
> $dbh->{'csv_tables'}->{my_table} = {
>    'eol' => "\n"
>    'file' => "my_table.csv",
>    'col_names' => $columnNames
> };
>
> Rick
>
> On Thursday 19 July 2001 11:50 am, you wrote:
> > I'm using DBD::CSV v0.1027 with DBI v1.18 and perl 5.6.1 on RedHat Linux
> > and it seems as though DBD::CSV only fully processes files saved in DOS
> > format(?!).  If I save them in UNIX format only the first row makes it
> > into each of the tables.
> >
> > Is this deliberate?
> >
> > --
> > Haben Sie spaß, aber tun Sie es nicht in den Brunnen.
> > --
> >
> >
> > _________________________________________________________________
> > Get your FREE download of MSN Explorer at
> > http://explorer.msn.com/intl.asp

Reply via email to