Robert Grant wrote:
>
> Is it possible to have DBD:CSV ignore comment lines and blank lines
> within the 'csv' file?
>
> For example,
> ------------------
> #Comments
> #Comments
> Field1,Field2
> data1,data2
Well DBD::CSV (or DBD::AnyData) won't ignore the comments, but you can
use those DBDs and ignore the comments yourself. You can't have the
comments above the field names, but below the field names you can just
have the comment treated as a single field record (put quotes around it
if it contains commas):
Field1,Field2
#Comment
"#Comment Long comment with commas, etc."
data1,data2
Then weed out the comments in your SELECT:
my $sth = $dbh->prepare(qq{
SELECT *
FROM table1
WHERE NOT Field1 LIKE '#Comment%'
});
--
Jeff