Skip to content

Instantly share code, notes, and snippets.

@speedsticko
Created October 28, 2013 02:19
Show Gist options
  • Save speedsticko/7190458 to your computer and use it in GitHub Desktop.
Save speedsticko/7190458 to your computer and use it in GitHub Desktop.
Get lines from log file contains timings, redirect repl output to fie.
(defmacro redir [filename & body]
`(binding [*out* (clojure.java.io/writer ~filename)] ~@body))
(redir "outfile.txt"
(with-open [rdr (clojure.java.io/reader "infile.txt")]
(doseq [line (filter #(.contains % "marker") (line-seq rdr))]
(println line)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment