Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Best way to compare two filesby sparkel (Acolyte) |
on Nov 01, 2004 at 13:27 UTC ( [id://404295]=perlquestion: print w/replies, xml ) | Need Help?? |
sparkel has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
As per your reply, the file comparison should not compare line by line, but it should compare sentences that are different from File 2 to File 1: Hence even if, "A big bad witch lived inside " is on different lines, it does not appear in the output
I am assuming that even if a line is repeated, since it has already appeared, it is ignored and not printed in the output Please let me know what you suggest.
Thank you,
Thank you for your reply. As per your request, here are some samples:
File 1:
File 2: Hence, the file comparison (Finding what is different about File 2 from File 1) should ignore the lines that have dates on them. Hence, the output will be:
Red riding hood knocked on a big wooden door
Please suggest,
I am a newbie to Perl, please be kind :) I wanted to know what you felt was the best way I can compare two files. Hence, except changes in dates (i.e. Ignoring lines that have dates like October 10th, October 31st etc.) , I want to grab all other different lines between the two files that I find. Please suggest,
Thanks,
Back to
Seekers of Perl Wisdom
|
|