Scripting Question
Ray Parrish
crp at cmc.net
Mon Feb 16 12:38:23 UTC 2009
Hal Burgiss wrote:
> On Mon, Feb 16, 2009 at 3:11 AM, Steve Lamb <grey at dmiyu.org> wrote:
>
>> split(','). Do that once with a CSV with embedded commas and you go
>>
>
> In fairness to the rest of the scripting world, perl, php, ruby, etc
> all of which have very similar code:
>
> <?php
> $handle = fopen("test.csv", "r");
> while (($row = fgetcsv($handle, 1000, ",")) !== FALSE) {
> print $row[2] .',' . $row[3] ; //etc
> }
>
> Its also possible to have embedded quotes and embedded new lines.
>
Hello,
I've been following this thread, and I just have to ask. Why would any
good program which generated csv output allow any embedded commas in the
data? That seems kind of counter productive to me. I would think that
any program which generated csv output, would replace any commas within
the data with a space or some other character, so that the csv file
would work as intended.
Later, Ray Parrish
--
Human reviewed index of links about the computer
http://www.rayslinks.com
Poetry from the mind of a Schizophrenic
http://www.writingsoftheschizophrenic.com/
More information about the ubuntu-users
mailing list