Importing data for excel file or csv file


i have this website (with ajax also) with lot of records of employee,
and as an
extra feature i want that the customer can import his employeelist
(perhaps 100+
records), lot of work to do this manually.

i would create a template like this
Firstname Lastname Phone
xxxx xxxxx xxxxx
yyyy yyyyy yyyyy

then they upload the excel file or save it as csv file (with spacing
characters), i read the file and loop through it, and save the records
in the

does anyone has any experience with this???
thanks in advance.

Brutyn N. wrote:

My advice is to look at FasterCSV - I’ve just done/am refactoring
something very similar right now - it’s very few lines of code (and
sorry I cannot provide them)



thanks for that,
is there any doc for FasterCSV , cuz i download the zip and no docs in
there :s

i just need to read csv file, ead lines, and insert into database, thats



I am still working on this importing stuff. This all works till now.
I have clients, here i keep for each client the country info.
Like this:

<%= country_options_for_select(selected =, priority_countries = ['Belgium', 'Netherlands'] ) %>

But now also for the importing with csv, how must i slove this problem?
In the database is save the id of the countries, but the use will
probably fill
in the excel/csv file the name (what is normal).

Any ideas??

Also check for other problem (parsing validation to strings)

Thanks in advance

Brutyn N. wrote:


thanks for that,
is there any doc for FasterCSV , cuz i download the zip and no docs in there :s

There’s a Readme, which tells you “See FasterCSV for documentation.”

In other words, the documentation is RDoc documentation for the
FasterCSV class, which you will find in the file faster_csv.rb

And there are the tests…



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs