hey, 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 database. does anyone has any experience with this??? thanks in advance.
Brutyn Nick wrote:>hey, > >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 >database. > >does anyone has any experience with this??? >thanks in advance. > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >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) Kev
hey, 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 all thx
Hey, 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: <select name="client[country]"> <%= country_options_for_select(selected = @client.country, priority_countries = [''Belgium'', ''Netherlands''] ) %> </select> 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) http://article.gmane.org/gmane.comp.lang.ruby.rails/33460 Thanks in advance Nick
Brutyn Nick wrote:> hey, > > thanks for that, > is there any doc for FasterCSV , cuz i download the zip and no docs in there :sThere''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... regards Justin> > i just need to read csv file, ead lines, and insert into database, thats all > > > thx > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >