Steve Eichert on 7 Mar 2007 18:05:01 -0000


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

Re: [PhillyOnRails] importing from csv


I'm using FasterCSV [1] and just building my activerecord objects from the rows that it provides.  If you have a header it lets you access the column data by field name like so:

person = Person.new
p.first_name = row.fields(:first_name)
...
p.save

I found out about FasterCSV from this blog entry: http://www.luretanker.no/blog/2007/01/29/comma-separated-objects-csv-orm/

[1] http://fastercsv.rubyforge.org/

On 3/7/07, Aaron Blohowiak < aaron@aaronblohowiak.com> wrote:
How many records? How regularly?

Aaron Blohowiak

On Mar 7, 2007, at 12:08 PM, Flinn Mueller wrote:

Anyone have a spectacular method for importing data from CSV for ActiveRecord?   Thanks -- flinn
_______________________________________________
To unsubscribe or change your settings, visit:



_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk


_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk