Scripting Question

Derek Broughton derek at pointerstop.ca
Mon Feb 16 15:46:30 UTC 2009


Robert Parker wrote:

> On Mon, Feb 16, 2009 at 3:11 PM, Steve Lamb <grey at dmiyu.org> wrote:
>> Derek Broughton wrote:
>>> Hal Burgiss wrote:
>>>> cut -d, -f2,4,57,59,61 $csvfile |grep @
>>
>>> Cute :-)  There's always another, simpler, way...
>>
>>    Except, as pointed out, when there are embedded commas in a field.
>> That is why none of the people suggesting Python suggested using
>> split(',').  Do that once with a CSV with embedded commas and you go
>> running to you local Python documentation to read up on the csv module.
> 
> Wouldn't that render a comma separated csv file useless no matter what you
> did? Afaik there is an option to separate using tabs at creation time.

They _are_ pretty nearly useless, which _is_ why they have tab-separated
files.  But the original idea was that you could have commas in strings as
long as your strings were quote-delimited.  Then you have the issue of
quotes in quotes strings, etc, etc...





More information about the ubuntu-users mailing list