[mdlug] csv files
Michael Corral
micorral at comcast.net
Tue Dec 8 20:52:01 EST 2009
2009-12-08, Monsieur Carl T. Miller a ecrit:
> Aaron Kulkis wrote:
>> man cut
>> look at the flag to set the field separator to ','
>
> Of course this wouldn't work correctly if there were a
> comma inside the data, which is allowed in csv files.
>
> For example this data wouldn't parse correctly using cut.
>
> "Name","Age","Description"
> "Fred",3,"A great, big thing"
Actually, it would:
cut -d, --complement -f 1-2 file.csv | tr -d '\042'
Michael
More information about the mdlug
mailing list