Monday, July 27, 2009

CSV (Comma Separated Values) Processing in Ruby

FasterCSV rocks. You can find it here:
http://fastercsv.rubyforge.org/

Start by installing it using the gem.

sudo gem install fastercsv


After that, you are all set. Just make sure you require rubygems first.

require 'rubygems'
require 'fastercsv'

i=0
FasterCSV.foreach('blogs.csv') do |row|
i=i+1
puts("#{row[2]}")
end

As you can see from above, the row is an array that contains the values from the CSV file.

10 comments:

peterjohn said...

I appreciate you sharing this article. Really thank you! Much obliged.
This is one awesome blog article. Much thanks again.


sap online training
software online training
sap sd online training
hadoop online training
sap-crm-online-training

peterjohn said...
This comment has been removed by the author.
peterjohn said...

I really enjoy the blog.Much thanks again. Really Great.
Very informative article post. Really looking forward to read more. Will read on…


oracle online training
sap fico online training
dotnet online training
qa-qtp-software-testing-training-tutorial

Shruthi Kumari said...

Latest Govt Jobs 2016
Telangana TS 9096 Police SI Constable Recruitment 2015-16
Good Article, Thanks to Author for sharing

Sumathi Reddy said...

Latest Govt Bank Jobs Recruitment Notification 2016

This is my first time visit at here and i am truly happy to read this post......

sssjobs .in said...

Very good information thank you for sharing.A very useful website specially for the latest news in india govt jobs

Read More
government jobs in tamilanadu

Anna said...

Great and Useful Article.

Online Java Training

Java Online Training India

Java Online Course

Java EE course

Java EE training

Best Recommended books for Spring framework

Java Interview Questions








Java Course in Chennai

Java Online Training India

kingrani said...

Recruitment Notification is one of the Top most Job Portal Latest jobs in 2017there

kingrani said...



JNTUK 4-1 Results Check

pc shop said...

Thank u for Sharing this Information. For more cashback Offers And cashback coupons just ping me