davidsantiago / clojure-csv

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

Parsing/casting function support? #27

Closed metasoarous closed 9 years ago

metasoarous commented 9 years ago

It would be nice to be able to parse/cast data as it comes in from a csv file. For instance, convert numerical columns by specifying something like :cast-fns {2 (fn [s] (Integer/parseInt %))}. Would be even extra awesome to have "file sniffing" support, as R does, to look ahead and guess types in columns. As with #26, happy to contribute this or create my own project with these additional features.

davidsantiago commented 9 years ago

Yeah, as with #26, I would be concerned if Clojure-CSV couldn't be used to accomplish what you are talking about, but I think what you are talking about is a worthwhile and useful project and can stand on its own as higher level code.

metasoarous commented 9 years ago

I hear you on that (and on #26), and respect the decision to keep this a focused core. I sort of figured as much, actually, but wanted to offer contributing the code before spending too much time working on my own library (which is in early form here).

Glad you think it a worthwhile and useful project. For now I'm building it on clojure/data.csv, but I'd like for clojure-csv to be specified as an option as well, FWIW.

Cheers