# Add contacts in those excel file to contact list

**URL:** <https://www.ruby-forum.com/t/add-contacts-in-those-excel-file-to-contact-list/185655>\
**Category:** Rails\
**Created:** [March 24, 2010, 6:30am UTC](https://www.ruby-forum.com/t/add-contacts-in-those-excel-file-to-contact-list/185655 "2010-03-24T06:30:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [March 24, 2010, 6:30am UTC](https://www.ruby-forum.com/t/add-contacts-in-those-excel-file-to-contact-list/185655/1 "2010-03-24T06:30:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [March 24, 2010, 9:21am UTC](https://www.ruby-forum.com/t/add-contacts-in-those-excel-file-to-contact-list/185655/2 "2010-03-24T09:21:31Z")

</div>

Tony A. 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](https://github.com/thoughtbot/paperclip)**
>
> Easy file attachment management for ActiveRecord. Contribute to thoughtbot/paperclip development by creating an account on GitHub.

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

> **[Automating Excel with Ruby](http://rubyonwindows.blogspot.com/2007/03/automating-excel-with-ruby.html)**
>
> EXAMPLE: Assuming that data represents a 2-dimensional array that you wish to write to a Microsoft Excel worksheet, here's a code snippet, ...

If not you can try parseexcel

[http://www.codeweblog.com/parseexcel-ruby-used-to-read-excel/](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](http://snippets.aktagon.com/snippets/246-How-to-parse-CSV-data-with-Ruby)

Kind Regards  
Luke

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [March 24, 2010, 10:14am UTC](https://www.ruby-forum.com/t/add-contacts-in-those-excel-file-to-contact-list/185655/3 "2010-03-24T10:14:45Z")

</div>

Luke P. wrote:

> Tony A. 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](http://github.com/thoughtbot/paperclip)
> 
> Excel is a bit more tricky, if you are on windows you can automate it  
> with win32ole:
> 
> [Ruby on Windows: Automating Excel with Ruby](http://rubyonwindows.blogspot.com/2007/03/automating-excel-with-ruby.html)
> 
> If not you can try parseexcel
> 
> [http://www.codeweblog.com/parseexcel-ruby-used-to-read-excel/](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](http://snippets.aktagon.com/snippets/246-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?

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [March 24, 2010, 12:27pm UTC](https://www.ruby-forum.com/t/add-contacts-in-those-excel-file-to-contact-list/185655/4 "2010-03-24T12:27:31Z")

</div>

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

David

On Mar 24, 2010 5:16 PM, “Tony A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Luke P. wrote: \> Tony A. wrote: \>\> hi i wanted to upload a  
file  
using file uploader…  
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?

– Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/). – You received this message  
because you are subscribed…
