From: kranthi reddy Date: 2008-07-22T14:38:33+09:00 Subject: Re: read CSV file using csv library ------=_Part_65932_9232140.1216705445688 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hey you can use faster csv instead using the standard csv ruby library. Anyways the answer to your question is as below CSV::Reader.parse(File.open('/root/Desktop/lukcy.csv', 'rb')) do |row| p.row end This reads the entire row form the csv file.When you need a specific row to be rread you can use the foreach iterator or something like row[0] which returns the entire first column elements. kranthi. On Tue, Jul 22, 2008 at 12:43 AM, Li Chen wrote: > Hi all, > > I need to read a CSV file with csv library. And I tried the example from > the library. > > require 'csv' > > CSV::Reader.parse(File.open('test.csv')) do |row| > puts row > # break if !row[0].is_null && row[0].data == 'stop' > end > > Here is what I got: > # > ... > # > > > I wonder why I can't print out the string/row itself instead of the > address of the string/row. > > > Thanks, > > Li > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_65932_9232140.1216705445688--