Is anyone aware of any tutorials that demonstrate how to import data in a Ruby app with FasterCSV and saving it to a SQLite or MySQL database?
Here are the specific steps involved:
- Reading a file line by line (the
.foreach
method does this according to documentation) - Mapping header names in file to database column names
- Creating entries in database for CSV data (seems doable with
.new
and.save
within a.foreach
block)
This is a basic usage scenario but I haven't been able to find any tutorials for it, so any resources would be helpful.
Thanks!