I have a bunch of csvs for schools that i need to build School objects
out of and save.  The format and arrangement of columns is different
between them, but they all use the same column headers strings to
represent the same thing.  In other words, the order of columns is
different and some have more than others.  But they all have "Name" to
represent the name of the school.

For example (the real data is tab-separated but i've used spaces here
for clarity):

file_a.csv
Name          Type         Size
Fake Hill     Secondary    450
Brook Street  Primary      300

file_b
Size  Name
450   Notting Hill
200   Camden Street

is there an easy way to pull the data in, using the column headers to
decide what attribute is being set by each number?  So, that i could
import from a bunch of files without having to manually associate the
column index with what attribute it is setting, as long as the column
names are consistent?

thanks
max
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to