Flinn Mueller on 10 Mar 2007 03:04:33 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] importing from csv


On Mar 9, 2007, at 7:03 PM, Jason Yates wrote:
ary_of_values = Array.new
FasterCSV.foreach( file ) {|row| ary_of_values << row.to_a }
Customer.import [:name, :address, :zip, :city, :state, :phone ], ary_of_values

That looks pretty nice. I would need to verify the CSV data in a smart way before importing but that looks like a start. Thanks.
_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk