Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

nicholas maddren
nicholas maddren
12,793 Points

Modifying a CSV with Ruby

I want to create a system that will import a CSV file from a server via ftp onto my web server, then make some changes to it for example merge it with another CSV file to make one stock list instead of two and then deliver it to a FTP when those changes have been made.

I have learnt quite a bit of PHP and have learnt that it is build for the web so I don't feel like it could be achieved with PHP.

Could Ruby hold the answer? Would Ruby be able to make changes to a CSV on a server when a client runs a script to make those changes, if so I will begin learning it?

Thanks any info would be awesome

1 Answer

Ralph King
Ralph King
3,819 Points

Ruby has a CSV library that will allow you do almost everything you need - have a look at the documentation here: http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html

I also found this useful when I wanted to learn the basics of the Library http://www.sitepoint.com/guide-ruby-csv-library-part/