[Gllug] Controversial Joel Spolsky article

Richard Jones rich at annexia.org
Tue Dec 16 13:54:23 UTC 2003


I think that while /etc/passwd (let's call it 'colon delimited
format') is simpler to parse than CSV, there are some advantages to
CSV. I perhaps wouldn't have thought about that had I not just
recently been involved in a project which makes extensive use of
reading and writing CSV files generated by / for Excel.

CSV can do some clever things, such as encoding 8 bit data well,
including ',', '"' and '\n' within fields.

It is, of course, a completely undocumented format AFAIAA, but very
easy to reverse engineer given an hour or so with Excel.

If anyone's interested, I've got code which can read and write CSV
files, including all the nasty corner cases like fields containing
\n. It's just 187 lines of ML, a lot of which is comments describing
the file format, which compares very favorably with an equivalent
implementation in Perl.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Learning Objective CAML for C, C++, Perl and Java programmers:
http://www.merjis.com/richj/computers/ocaml/tutorial/
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list