Clement Ow wrote:
> Cheyne Li wrote:
>> Hi, there
>> 
>> Is there a simple way to find the difference between two files? I'm a
>> new ruby learner. I'm not familiar with the Stander class in Ruby. Is
>> there any can find the difference between two files and return a string
>> or array?
> 
> What kinda difference do you wanna look at? is is file attributes?
> 
> You can try something like File.compare or File.fnmatch which wll return 
> true if the file matches..
> 
> If it's not something what you really need, please do explain your 
> situation abit more and maybe more people might be able to help ;)

Ok, I need to compare the contents in 2 files. Print out each difference 
in both files. for example, if i have 2 files: f1.txt, f2.txt

in f1:                                  in f2:
I'm learning ruby.                      I'm learning ruby.
I'm not good at it.                     I'm good at it.

So, I want to know if there a function can return an array that contains 
"I'm not good at it." and "I'm good at it."

I wonder if I have to compare line by line or there is function in Ruby 
would do that for me.
-- 
Posted via http://www.ruby-forum.com/.