Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Parsing CVS files



Hi folks,

I'm looking for an easy way to split the lines of a .csv file into
the fields of an array variable.  There's a script that does that
somewhore on the net.  But that script parses lines character by
character and just manages to parse about 100 (long) lines per
second.

Fields in a .csv file are separated by commas, *but* commas
between a pair of quotes do not split.  Or phrased differently:
Commas that have an even number of double quotes left of them do
split, but commas with an uneven number left of then don't split.

Any ideas for a quick implementation?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Messages sorted by: Reverse Date, Date, Thread, Author