Created
March 1, 2017 04:09
-
-
Save atroche/91a65a2a552bc739bbfbd428aa1bf0b7 to your computer and use it in GitHub Desktop.
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
(with-open [rdr (FileInputStream. ten-gb-json-file)] | |
(loop [line-count 0] | |
(let [bytes-read (.read rdr buffer)] | |
(if (>= bytes-read 0) | |
(let [lines (count (filter #(= \newline %) | |
buffer))] | |
(recur (+ line-count lines))) | |
line-count)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment