title: dealing with large CSV files (20G) in ruby
body: <p>I am working on little problem and would have some advice on how to solve it:
  Given a csv file with an unknown number of columns and rows, output a list of columns with values and the number of times each value was repeated. without using any library.</p>
  
  <p>if the file is small this shouldn't be a problem, but when it is a few Gigs, i get NoMemoryError: failed to allocate memory. is there a way to create a hash and read from the disk instead of loading the file to Memory? you can do that in perl with tied Hashes</p>
  
  <p>EDIT: will IO#foreach load the file into memory? how about File.open(filename).each?</p>