Skip to content

Instantly share code, notes, and snippets.

@brianlamb
brianlamb / gist:7682256
Last active December 29, 2015 14:09
Ruby 1.8.7 CSV example
#pre-fastercsv examples to import CSV data in Ruby 1.8.7
require 'csv'
CSV::Reader.parse(File.open('./db/sample_tasks.dat'), fs = 9) do |row|
next if row[0] == 'name'
Task.create!(
:name => row[0],
:description => row[1],
:duration => row[2],
:due_date => row[3],