From: Adam Shelly Date: 2008-05-13T07:24:33+09:00 Subject: Re: array diff On 5/12/08, James Dechiaro wrote: > the problem i'm running into is when i try to open back the csv1 and > compare the SumArray against it in order to get the entire line (not > just the element). It instead prints all the lines, even the ones not > contained in the array. > > So it looks as though the .eql? module is not working correctly. > There are a few potential problems with this line: records.collect do |row| row[1].eql?(SumArray) First, I think you need an 'if'. Otherwise you are calling eql? but not using the result. Second, it looks like you are comparing a single field with the whole SumArray. They will never be equal. You probably want something like if SumArray.include?(row[1]) -Adam