From: James Edward Gray II Date: 2007-02-27T04:01:45+09:00 Subject: Re: Parsing CSV On Feb 26, 2007, at 12:54 PM, James Edward Gray II wrote: > On Feb 26, 2007, at 11:48 AM, James Edward Gray II wrote: > >> If you can afford to read one of the files into memory because >> it's not too large, you can probably speed that up quite a bit: >> >> require "set" >> >> allowed = Set.new >> FCSV.foreach(tdest) do |row| >> allowed.add(row[scomp_args[0]..scomp_args[1]].join(" ")) >> end >> >> passvalues = FCSV.open(fsource) do |source| >> source.select do |row| >> allowed.include? row[scomp_args[0]..scomp_args[1]].join(" ") >> end >> end > > The above destroys the field order. Sorry, I meant row order. James Edward Gray II