Sam Gentle wrote:
   snip
> I'd do something like this:
> 
> require 'enumerator'
> 
> data = File.readlines(path)
> additional_data = File.readlines(second)
> data.concat(additional_data)
> 
> data.sort!
> mergeddata = [data[0]]
> data.each_cons(2) {|x1,x2| mergeddata.push(x2) unless x1.split(/,/)[1]
> == x2.split(/,/)[1]}
> 
> Sam

Sam, that works great.  Unfortunately I still don't understand it all 
yet.

mergedata = [data[0]]  - creates an new array from data, but why do we 
need the subscript??

data.each_cons(2)... - what does the each_cons(2) do... I understdand 
the split, but don't know the .push(x2)

I will go do some more reading to see if I can figure them out.

Thanks
Snoopy

-- 
Posted via http://www.ruby-forum.com/.