K
Kamarulnizam Rahim
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
#!/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