Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7831195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:37:01+00:00 2026-06-02T11:37:01+00:00

I am looking for a clojure-csv library example that uses write-csv. Specifically, how are

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:37:02+00:00Added an answer on June 2, 2026 at 11:37 am

    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.

    (defproject so "example"
      :dependencies [[org.clojure/clojure "1.3.0"]
                     [org.clojure/data.csv "0.1.2"]])
    

    Example code of creating a function which takes a filename and the data to write to a csv.

    (ns so.core
      (:require [clojure.data.csv :as csv]
                [clojure.java.io :as io]))
    
    (defn csv [filename data]
      (with-open [f (io/writer filename)]
        (csv/write-csv f data)))
    

    Using csv from the repl.

    so.core> (csv "example.csv" [["stack" 1]
                             ["example" 40]])
    

    And here is what example.csv looks like.

    $ cat example.csv 
    stack,1
    example,40
    

    Hopefully this helps out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for an example that: Launches an EXE Waits for the EXE to finish.
I am looking through some example Fibonacci sequence clojure code: (def fibs (lazy-cat [1
I'm trying to figure out corecursion in Clojure with nontrivial (i.e. not Fibonacci), but
I'm looking for a Clojure equivalent of Nokogiri in Ruby. Specifically, I want to
I'm looking for a more idiomatic way, if possible, to write the following clojure
Looking for a build-time CSS combiner/minifier that respects relative URL references. That is, if
Looking around the web, I've seen this simple pattern that implements a (thread-safe) singleton
Looking for C# class which wraps calls to do the following: read and write
Looking at what's running and nothing jumps out. Thanks!
I'm looking for an idiomatic way to get dynamically scoped variables in Clojure (or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.