23. A CSV Reader

Sooner or later, in your day-to-day work you’ll need to read a comma-separated value (CSV) file and perform an operation on the result. To make it even more interesting, we’re going to do this exercise with four million rows.

In this recipe we’ll write a large CSV to a file, and then read it in Clojure in a way that bypasses the performance overhead of the Clojure reader.

Assumptions

In this chapter we assume the following:

Image You have 300 MB of disk space spare.

Image You’re OK with waiting 4 minutes for a process to finish.

Benefits ...

Get Clojure Recipes now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.