add contacts in those excel file to contact list

hi i wanted to upload a file using file uploader. alsoi wanted to add those contacts in those excel file to contact list how i can do this in rails.pls help

Tony Augustine wrote:

hi i wanted to upload a file using file uploader. alsoi wanted to add those contacts in those excel file to contact list how i can do this in rails.pls help

To upload look at the paperclip plugin:

Excel is a bit more tricky, if you are on windows you can automate it with win32ole:

If not you can try parseexcel

http://www.codeweblog.com/parseexcel-ruby-used-to-read-excel/

I haven't had huge success with that though (images in files have caused problems for me) and I've tended to just get users to upload a csv instead and use the built in CSV or FasterCSV - there are some other options listed here:

http://snippets.aktagon.com/snippets/246-How-to-parse-CSV-data-with-Ruby

Kind Regards Luke

Luke Pearce wrote:

Tony Augustine wrote:

hi i wanted to upload a file using file uploader. alsoi wanted to add those contacts in those excel file to contact list how i can do this in rails.pls help

To upload look at the paperclip plugin:

GitHub - thoughtbot/paperclip: Easy file attachment management for ActiveRecord

Excel is a bit more tricky, if you are on windows you can automate it with win32ole:

Ruby on Windows: Automating Excel with Ruby

If not you can try parseexcel

http://www.codeweblog.com/parseexcel-ruby-used-to-read-excel/

I haven't had huge success with that though (images in files have caused problems for me) and I've tended to just get users to upload a csv instead and use the built in CSV or FasterCSV - there are some other options listed here:

How to parse CSV data with Ruby

Kind Regards Luke

actuallly i think u ddnt get ma requirement

i wanted to upload a file using paperclip plugin and then i need to upload an excell sheet intodb which shows d path of files and some more parameters.also how i can take values from an csv file?

You might need to use a parser like fastercsv to get values out of your csv.

David