[DCSV-6] read-csv can not handle white-space at end of line Created: 24/May/13 Updated: 29/May/14
|Reporter:||Cees van Kemenade||Assignee:||Jonas Enlund|
When whitespace is present after the closing \" the clojure reader crashes with a weird error.
See an example of the error below.
=> (read-csv (java.io.StringReader. "\"a\" " ))
|Comment by Cees van Kemenade [ 24/May/13 4:35 PM ]|
To take the issue a little further, the same holds for whitespace in the middle of a line between the closing-quote and the separator, see:
This raises the question what happens if you put a space between the separator and the opening quote (first the default case):
Now adding one additional space:
Interesting, the white-space is considered to be the start of the string and the quote that follows is considered to be part of the tekst-value that is read.
Now we see that the separator is not quoted anymore and as expect, the line is interpreted to contain three values instead of two values.
When using standard libraries the issues mentioned above usually do not appear. However, in custom code that emits csv-files or when doing small manual fixes in a csv it is easy to introduce such an issue/error and subsequently it is quit tough to analyse this issue correctly.
|Comment by Paul Schulz [ 29/May/14 9:29 AM ]|
This is related to DSCV-8
A quote at the beginning of the string, and ending in the middle of the string (eg. where additional characters appear after second quote) will cause the same problem.