From: Rafael George Date: 2007-02-26T23:45:40+09:00 Subject: Re: Parsing CSV passvalues = [] i = 0 IO.foreach(fsource) do |line| cols = [] cols=CSV::parse_line line.chomp sourceval = cols[scomp_args[0]] + " " + cols[scomp_args[1]] IO.foreach(tdest) do |line| tcols = [] tcols=CSV::parse_line line.chomp testval = tcols[tcomp_args[0]] + " " + tcols[tcomp_args[1]] if sourceval == testval passvalues[i] = sourceval i += 1 end end end Here is what i got On 2/26/07, Stephane Elie wrote: > This code might get you started: > > require 'FasterCSV' > > def read_csv(filename) > return FasterCSV::Table.new( FasterCSV.read(filename) ).by_col > end > > data1 = read_csv("data1.csv") > data2 = read_csv("data2.csv") > > compare_column_idx = 1 > unless data1[compare_column_idx] == data2[compare_column_idx] > puts "column #{compare_column_idx} is different" > end > > Regards, > Stephane > > -- > Posted via http://www.ruby-forum.com/. > > -- Grimoire Guru SourceMage GNU/Linux