Great!  Someone's already done the work.

This should be in everyone's toolkit,

Bob Schaaf


On Jul 25, 2009, at 9:04 AM, Brian Candler wrote:

> Hunt Hunt wrote:
>> I have a file which information.txt which is like
>>
>> name,address,city,contact
>> abc,Newyork,HYU,345
>> xyz,Pittsurg,UYY,234
>
> require 'rubygems'
> require 'fastercsv'
> FasterCSV.foreach("information.txt", :headers=>true) do |row|
>  p row['name']
>  p row['address']
>  p row['city']
>  p row['contact']
> end
> -- 
> Posted via http://www.ruby-forum.com/.
>