Skip Menu |

This queue is for tickets about the Text-CSV-Simple CPAN distribution.

Report information
The Basics
Id: 8223
Status: resolved
Priority: 0/
Queue: Text-CSV-Simple

People
Owner: Nobody in particular
Requestors: steve [...] purkis.ca
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: can't handle newlines in fields
Heya, Text::CSV::Simple can't handle newlines in the content.. For example, this is valid content of a CSV file: "Multimap, offices of",my street,London,EC1N 2NS,GB,1234,,,16,,,,, Which Text::CSV_XS can handle (using binary => 1). The problem stems from using the approach: # in read_file() foreach my $line (@lines) { I haven't had time to look into it, but it should be possible to use: $csv_cs->getline( $fh ) Which gets around the problem (also means you're not responsible for reading file content). It may require a change in approach though... hth, -Steve
Date: Wed, 3 Nov 2004 23:54:25 +0000
From: Tony Bowden <tony [...] kasei.com>
To: Guest via RT <bug-Text-CSV-Simple [...] rt.cpan.org>
Subject: Re: [cpan #8223] can't handle newlines in fields
RT-Send-Cc:
On Wed, Nov 03, 2004 at 07:36:45AM -0500, Guest via RT wrote: Show quoted text
> Text::CSV::Simple can't handle newlines in the content.. For example, this is valid content of a CSV file: > "Multimap, > offices of",my street,London,EC1N 2NS,GB,1234,,,16,,,,, > Which Text::CSV_XS can handle (using binary => 1).
Ouch. I didnt' realise that was valid CSV :( Show quoted text
> I haven't had time to look into it, but it should be possible to use: > $csv_cs->getline( $fh ) > Which gets around the problem (also means you're not responsible for > reading file content). It may require a change in approach though...
It certainly will. The docs for Text::CSV_XS are at best ambiguous and at worst misleading on this though. getline certainly reads like it would suffer from the same problem. I'll toss this one around in my head for a while longer ... Thanks, Tony
Show quoted text
> >> Text::CSV::Simple can't handle newlines in the content.
> > Ouch. I didnt' realise that was valid CSV :(
> Neither did we, until customers started to complain ;-/
I've decided to take the easy way out here and document that this is outside the scope of a ::Simple module :( Thanks for the report though. Tony