[mdlug] csv files

Aaron Kulkis akulkis00 at gmail.com
Tue Dec 8 20:36:44 EST 2009


Carl T. Miller wrote:
> Aaron Kulkis wrote:
>> Carl T. Miller wrote:
>>> Are there any good command line tools to work with csv files?
>> AT&T developed some commands for doing this decades ago.
>>
>> 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"

In that case, you need the slightly more sophisticated
tool called "awk"

There's a very good tutorial for awk in Volume 2 of the
Version 7 documentation.

google for "version 7 man" and you should find a
page in, I think Dennis Richie's directory, with
the complete version 7 documentation in 3 PDF files:

Volume 1  (manual pages)
Volume 2a (tutorials)
Volume 2b (more tutorials)



More information about the mdlug mailing list