3 ms·
Processing large CSV files with Ruby
- deleted 11y ago[deleted]
- fiatmoney 11y agoWideFinder is a good benchmark for file-processing tasks. This is a writeup of approaches in Clojure: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html http://meshy.org/2009/12/13/widefinder-2-with-clojure.html
- gonyea 11y agoCSV.open also uses a file handle (and takes a block). So File.open would be redundant. A fun hack is to use the threach library (threaded each) on the CSV object. Used with JRuby you can run on all cores to quickly process a large file, while keeping memory usage light.