davidsantiago / clojure-csv

A library for reading and writing CSV files from Clojure
187 stars 35 forks source link

Added support for files edited on a mac (cr line termination) #25

Closed stanfea closed 9 years ago

stanfea commented 9 years ago

added support for mac line termination carriage return only

davidsantiago commented 9 years ago

This should already be possible, using the :end-of-line option. Is that not working?

stanfea commented 9 years ago

hi sorry for delay yes this works if specified in :end-of-line option.

but would be nice to have it work out of the box

davidsantiago commented 9 years ago

OK, I see. Your code looks fine, but I am going to decline the patch. The reason is that always checking for this pretty rare format has a runtime cost that is then imposed on everyone. That's why it's been optional. I do understand your desire though, so my suggestion would be to write your own function with the options you want, and then just call that. Something like this:

; Note: This was typed into the github form, have not tested it! But should be close to correct.
(defn my-parse-csv [input] (csv/parse-csv input :end-of-line "\r"))
stanfea commented 9 years ago

ok I understand thanks for your time