Scripting Question

Smoot Carl-Mitchell smoot at tic.com
Mon Feb 16 13:44:01 UTC 2009


On Mon, 2009-02-16 at 04:38 -0800, Ray Parrish wrote:

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

That is why text fields are quoted.  A good CSV parser recognizes the
quoted strings.  The Python CSV parser does this.  There is also a good
CSV parsing module for Perl which also accounts for quoted fields.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list