Created
          October 28, 2013 02:19 
        
      - 
      
 - 
        
Save speedsticko/7190458 to your computer and use it in GitHub Desktop.  
    Get lines from log file contains timings, redirect repl output to fie.
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | (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