Hello, all --

Some reports coming as CSV from a front-end/database written in/for an old version of foxpro are broken because of misplaced newlines.

To illustrate:

my @data;
my $oldtotal;
while (@data = $sth->fetchrow_array()){
$oldtotal= $total;

map { $total += $_=~m#[\r\f]+#g } @data;

print $data[2], "\n" if ($total != $oldtotal);
}
print $total;

The same routine, connecting via the ODBC system dsn with ::OLE, nets 563 -- with ::ADO (eventually), 182. With ::XBase, I get 205 total matches. What fun.

So, with a s/[\r\f]+//g; type of thing, what else should go in the regex? Is it okay to replace with nothing (//)?

Any strategies or advice from those who've been there?

And, why different match totals? Which driver _should_ I use, particularly as I want to fix it, not break it more? Getting different results here suggests there's maybe an important difference I'm just not getting, perhaps the source of the problem.

Thanks for _any_ help, advice, sympathy, rtfm!s, whatever. Someone, please let me know if I'm chasing my tail. '-)

-- mike higgins





Reply via email to