From: Cheyne Li Date: 2008-05-15T03:24:16+09:00 Subject: Re: Need help for finding difference between files Michael Linfield wrote: >> I wonder if I have to compare line by line or there is function in Ruby >> would do that for me. > > file1 = File.readlines("f1.txt") > file2 = File.readlines("f2.txt") > > file1&file2 > #=> "I'm learning ruby." > > The '&' symbol can be used to compare arrays, it will return any matches > between the 2. > > Regards, > > - Mac Thanks man. I found that using "-" can find all differences diff = file1 - file2 -- Posted via http://www.ruby-forum.com/.