Created
October 19, 2014 14:24
-
-
Save trendsetter37/db8fbcb3ee741f1e3730 to your computer and use it in GitHub Desktop.
Read text files into Clojure REPL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is to read files into repl for dev work | |
; You would replace println with your function | |
; That you would like to test on each line of | |
; the text file. | |
(defn do-stuff [file] ; file should be a string surrounded by double quotes | |
(with-open [rdr (clojure.java.io/reader file)] | |
(doseq [line (remove empty? (line-seq rdr))] | |
(println line)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment