When I say that it supports the RFC I mean that the library should be
able to read any file that follows that standard. It might (and it
does) read files that do not follow the standard. Here are some
examples:

1) quotes can appear anywhere, not only as the first and last
character in a cell.
2) records can be of different length.
3) any character can be used as quote or separator.
4) The problem you raised, i.e., that the file might end in a "quoted"
state and still be read without exceptions.

I'll consider adding a :strict flag which would throw an exception for
points 2 and 4. However, I don't want to sacrifice performance since I
consider that to be the most important feature in any csv reading
library (people often have Gb+ sized csv files).

Jonas



On Wed, Jun 9, 2010 at 6:54 AM, Kyle R. Burton <[email protected]> wrote:
>> I've added my work on the csv reader/writer library to github
>> (http://github.com/jonase/cljcsv). Please let me know If anyone finds
>> it useful.
>
> Thanks for the implementation, I'm very encouraged that you followed
> the RFC (I've seen lots of implementations that haven't).
>
> I took a quick look at both yours and clojure-csv [1].  I'm not using
> the 1.2 snapshots so I wasn't able to try out your implementation, but
> I did notice clojure-csv is lax about invalidly formatted files - if a
> quoted field ends the file but is not terminated before eof, it does
> not signal an error.  I think I recognize the same behavior in cljcsv
> as well (though as I said I could not try it).  It might be nice to at
> least have an option which allows an unterminated field to be
> recognized.
>
> Best Regards,
>
> Kyle
>
> [1] http://github.com/davidsantiago/clojure-csv
>
>> On Wed, May 26, 2010 at 6:40 AM, Jonas Enlund <[email protected]> wrote:
>>> Hi there
>>>
>>> I built a simple csv parsing library[1] last weekend which I want to
>>> show you guys. It follows the RFC 4180[2] pretty closely but it allows
>>> for any character as separator and quote mark. It would be great if
>>> someone would take time and read the code. I would like to know:
>>>
>>> a) Can performance still be improved?
>>> b) Is it idiomatically written?
>>> c) What should an idiomatic csv parsing API look like in Clojure?
>>> Currently there is only one public function, 'parse' (like
>>> clojure.xml).
>>>
>>> The end of the file contains a few usage examples.
>>>
>>> happy hacking!
>>> /Jonas
>>>
>>> [1] http://gist.github.com/414023
>>> [2] http://tools.ietf.org/html/rfc4180
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to [email protected]
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>
> --
> ------------------------------------------------------------------------------
> [email protected]                            http://asymmetrical-view.com/
> ------------------------------------------------------------------------------
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to