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.


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 the O’Reilly learning platform.

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