Re: csv parse bug...
- From: xhoster@xxxxxxxxx
- Date: 21 Jul 2005 17:46:39 GMT
"Prasad Gadgil" <prasad.gadgil@xxxxxxxxx> wrote:
> Hi,
>
> If I have wrongly posted this here instead of reporting this as a
> module bug, pl excuse me.
>
> I am facing an odd bug when using parse() function in Text::CSV module.
> This is an absolutely textbook use of the function which fails for some
> 30 records out of ~ 25000 records.
>
> I have checked, and have found a very strange pattern. In one of the
> possible fields which will have embedded commas qualified by double
> quotes (like "CN=XX ,OU=XX,OU=XX,DC=XX,DC=XX"), if a pattern line "
> ,OU" appears, the parse fails...
Do you think it might be useful for us to know what kind of failure
it reports?
> which means if there is a space before
> the embedded comma in one of the comma seperated fields, the parse
> fails.
Not in my hands, it doesn't.
[~/perl_misc]$ perl
use Text::CSV;
my $x='foo,"CN=XX ,OU=XX,OU=XX,DC=XX,DC=XX",bar';
my $csv=Text::CSV->new();
if ($csv->parse($x)) {
print join "\t", $csv->fields();
} else {
die $csv->error_input;
};
__END__
foo CN=XX ,OU=XX,OU=XX,DC=XX,DC=XX bar
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- Follow-Ups:
- Re: csv parse bug...
- From: Prasad Gadgil
- Re: csv parse bug...
- References:
- csv parse bug...
- From: Prasad Gadgil
- csv parse bug...
- Prev by Date: Re: comments in the middle of a hash variable ?
- Next by Date: perl/cgi exploit with bracketed module names passed in as CGI param
- Previous by thread: Re: csv parse bug...
- Next by thread: Re: csv parse bug...
- Index(es):
Relevant Pages
|