Re: csv parse bug...



"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
.



Relevant Pages

  • Re: csv parse bug...
    ... > module bug, pl excuse me. ... > I am facing an odd bug when using parse() function in Text::CSV ... This is an absolutely textbook use of the function which fails ... > possible fields which will have embedded commas qualified by double ...
    (comp.lang.perl.misc)
  • csv parse bug...
    ... 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 ... possible fields which will have embedded commas qualified by double ...
    (comp.lang.perl.misc)
  • Re: reading FAT32 drive in XP on NTFS main drive
    ... > know if it fails it has to fail at some time) and the drive manager is ... > reporting it as 'Health ' it just doesn;t have a drive letter!? ... >> properly, and I can see it in the drive manager, I cannot see it under ...
    (microsoft.public.windowsxp.hardware)
  • Re: copy_from_user again()
    ... I thought a little more about your patch. ... I aborted my version of it too) is that it becomes very inaccurate now in reporting. ... But you must never report finer granularity than you actually ... until it hits the exact byte that fails. ...
    (Linux-Kernel)
  • Re: [stable 2.6.24] WARNING: at kernel/time/clockevents.c
    ... the hrtimer code is preparing an invalid ktime_t. ... clockevents_program_eventactually fails when this happens - I am ... surprised that this is not causing observeable userspace problems. ... Frans, Thanks for reporting! ...
    (Linux-Kernel)