fastercsv gem
Gem details
Documentation
Install the Gem:
gem install fastercsv
Example use for a rails import
#!/usr/local/bin/ruby -w require "faster_csv" running_total = 0 FasterCSV.filter( :headers => true, :return_headers => true, :header_converters => :symbol, :converters => :numeric ) do |row| if row.header_row? row << "Running Total" else row << (running_total += row[:quantity] * row[:price]) end end
# >> Quantity,Product Description,Price,Running Total
# >> 1,Text Editor,25.0,25.0
# >> 2,MacBook Pros,2499.0,5023.0
Edit Gem | (0 older versions) | Last edited by: Guest, 3 months ago

