Skip to content

Instantly share code, notes, and snippets.

@fbmnds
Created July 24, 2013 13:24
Show Gist options
  • Select an option

  • Save fbmnds/6070536 to your computer and use it in GitHub Desktop.

Select an option

Save fbmnds/6070536 to your computer and use it in GitHub Desktop.
(require '[clojure.data.csv :as csv]
'[clojure.java.io :as io])
(defn multiply-string [s n]
(clojure.string/join [(clojure.string/join \newline (repeat n s)) "\n"]))
(defn multiply-file [in-file out-file n]
(with-open [rdr (io/reader in-file)
wrtr (io/writer out-file)]
(dorun (map #(.write wrtr (multiply-string % n)) (line-seq rdr)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment