Subject: RE: bug#6277: cut: Please add CSV parsing

From: "Voelker, Bernhard" <[email-masked]>
Date: Fri, 28 May 2010 08:46:29 +0200

Bob Proulx wrote:

> sandy bas wrote:
>> Comma delimited files often have fields of the form "big,black,bear"
>> where the commas within the quotes are not delimiters. A useful
>> option in cut would be to ignore the commas (delimiters) within the
>> quotation marks.
>> 
>> I would be glad to put it in if you would like the option.

> I suggest that you use Perl, Python or Ruby for CSV processing.  They
> include full libraries for dealing with the many varied details of CSV
> handling.

just to mention another classic UNIX tool: awk

	awk -F, '$1 ~ /^big$/ { print $2,$3 }' csv.txt

Have a nice day,
Berny