in reply to Re: CSV to SQL?
in thread CSV to SQL?
BTW: CPAN is your friend...
Oh yeah, I removed the ID column, for one you dont say where the id comes from and two if it was my table that column would be an identity column.
HTH.use strict; use warnings; use Text::CSV_XS; my $csv=Text::CSV_XS->new({binary=>1}); while (<DATA>) { chomp; last unless $csv->parse($_); my @vals=$csv->fields; print "INSERT INTO skjalaskra ('skjalamyndari', ". "'afhendingarar', 'skjalaflokkur', 'kassanumer'," . "'ork', 'fraar', 'tilar', 'innihald', 'yfirflokkur',". " 'athugasemdir')\n". " VALUES ('".join("', '",@vals)."')\n"; }
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
|
|---|