From: Michael Linfield Date: 2008-05-13T04:38:59+09:00 Subject: Re: array diff Same thing basically but none-the-less this would also work.. csv1 = [] csv2 = [] IO.foreach("csv1.csv") {|lines| csv1 << lines} IO.foreach("csv2.csv") {|lines| csv2 << lines} OR csv1 = [] csv2 = [] FCSV.foreach("csv1.csv", :headers => true) do |row| csv1 << row["headerName"] end FCSV.foreach("csv2.csv", :headers => true) do |row| csv2 << row["headerName"] end #this will give you the elements they dont share in common differenceArray = csv1-csv2 #this will give you the elements they DO share in common commonArray = csv1&csv2 Regards, - Mac -- Posted via http://www.ruby-forum.com/.