Re: Using clojure-csv with large files

2012-07-08 Thread Timothy Washington
Hmm, these are all good points. My source file just returns the sequence (as in *src.clj*). I have a midje test file (*test.clj*) that just asserts that it exists. *src.clj * (ns my-ns ... ) (defn load-config [] (let [config (load-file "etc/config.clj") dname (-> config :data :test)]

Re: Using clojure-csv with large files

2012-07-08 Thread Dustin Getz
what are you doing with the return value of csv/parse-csv? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your firs

Re: Using clojure-csv with large files

2012-07-08 Thread Sean Corfield
On Sun, Jul 8, 2012 at 9:34 AM, Timothy Washington wrote: > I'm trying out the Clojure-csv lib. But I run out of heap space when trying > to parse a large CSV file. So this call should return a lazy sequence. > > (csv/parse-csv (io/reader "125Mfile.csv")) If you are consuming the CSV lazily, you

Re: Using clojure-csv with large files

2012-07-08 Thread David Santiago
Yeah, CSV files can have embedded newlines, so you can't just split it up on linebreaks and expect it to work, you need to send them through a parser. parse-csv *is* lazy, so my question is, are you doing this at the repl, exactly as you wrote? If so, it will lazily parse the file, and then print

Re: Using clojure-csv with large files

2012-07-08 Thread Denis Labaye
Hi, I would try something like (untested): (map parse-csv (line-seq (clojure.java.io/reader "/tmp/foo.csv"))) But it will break for CSV cells with newlines like: a ; b foo;"bar baz" x ; z interesting ... Denis On Sun, Jul 8, 2012 at 6:34 PM, Timothy Washington wrote: > Hi there, > >

Using clojure-csv with large files

2012-07-08 Thread Timothy Washington
Hi there, I'm trying out the Clojure-csvlib. But I run out of heap space when trying to parse a large CSV file. So this call should return a lazy sequence. (csv/parse-csv (io/reader "*125Mfile.csv*")) Instead, I get a "*java.lang.OutOfMemoryError: