I am looking for a clojure-csv library example that uses write-csv. Specifically, how are the arguments formed? I cannot figure out why I am getting the following error below.
Here is my code example with error:
(def x [1 2 3 4])
(write-csv (spit "test.tmp" x) :end-of-line "\n")
ArityException Wrong number of args (3) passed to:
core$write-csv clojure.lang.AFn.throwArity (AFn.java:437)
Thank You.
EDIT Misread your question and didn’t realize you were asking about using the library clojure-csv. Going to leave this up in case it helps anyone else using clojure.data.csv.
If you are using leiningen put the following in your project.clj file.
Example code of creating a function which takes a filename and the data to write to a csv.
Using
csvfrom the repl.And here is what example.csv looks like.
Hopefully this helps out.