Skip to content

Instantly share code, notes, and snippets.

@atroche
Created March 1, 2017 04:09
Show Gist options
  • Save atroche/91a65a2a552bc739bbfbd428aa1bf0b7 to your computer and use it in GitHub Desktop.
Save atroche/91a65a2a552bc739bbfbd428aa1bf0b7 to your computer and use it in GitHub Desktop.
(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