
9 Oct
2006
9 Oct
'06
11:12 p.m.
On 2006-10-01, Pete Kazmier
For those that know python, here is a very simple implementation that happens to be very fast compared to my Haskell version and very short:
for line in sys.stdin: fields = line.split(',')
Of course, this doesn't handle quoted values that contain commas, which are among the many joys* of parsing CSV files. I might just point out the existance of MissingH.Str.CSV to you, which can read and write CSV files. See http://gopher.quux.org:70/devel/missingh/html/MissingH-Str-CSV.html for details. A one-line call gives you a [[String]]. This uses Parsec, so it will not be a top-notch performer, but it is elegant ;-) * I mean "joy" sarcastically, in case it wasn't obvious.