From: Kamarulnizam Rahim Date: 2011-01-12T10:12:57+09:00 Subject: Read .csv file. Cant obtain data Here is the code i use: #!/usr/bin/ruby require 'rubygems' require 'csv' ctr = 0 @data = [] CSV.foreach('C:/Users/nizam/test_q.csv') do |row| @data << row puts "#{row[0]} | #{row[1]}" #unless row[1] =~ /^\[x\] ctr += 1 end puts "#{ctr} rows" puts "Hello World" However, the output came like this: 0 rows Hello World Im pretty sure my .csv file has data in it. But when i run this script, non of the data come out. I wonder why?? Thanks Nizam -- Posted via http://www.ruby-forum.com/.