Subject: | Tab-delimited files with empty lines lose integrity |
I became puzzled when a SELECT statement was not returning all of the
data from a tab-delimited file. After much chin scratching I noticed
that the file had some empty lines, removed them, and I then got what I
expected.
I'm using Perl 5.8.8 on SunOS 5.8. The code I'm testing with is below;
the long col_names list has been removed for brevity:
my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
$dbh->func('mex_dir', 'Tab', 'data.txt', 'ad_catalog');
my $sth = $dbh->prepare('SELECT DISTINCT section FROM mex_dir');
$sth->execute();
while (my @row = $sth->fetchrow_array()) {
print Data::Dumper->Dump([\@row]);
}