onyxfish/csvkit — pull request #212 by billwanjohi (2013-05-24 22:11:13+00:00)
Title: Feature/add escape lf option

Excel spreadsheets often have cell values that span multiple lines. The CSV MIME Type only requires that you wrap such values in double quotes. This is sufficient for many CSV parsers, but breaks others.

I added an option to in2csv ('--escape_lf') that precedes every line feed character with a backslash, thus escaping it and preventing "dumber" parsers from treating the partial value as a separate row.

I tried to be as complete as possible, adding example data, tests, and a mention in the docs.