Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Compare two txt files and print the difference between the two files.

by Lotus1 (Chaplain)
on Feb 01, 2013 at 18:41 UTC ( #1016599=note: print w/ replies, xml ) Need Help??


in reply to Compare two txt files and print the difference between the two files.

The code you presented in the OP worked fine for me. I assume the problem you had understanding the output was due to the differences in whitespace at the ends of the lines in your sample text files. The whitespace made some of the lines appear to be different. Once I removed the extra whitespace here is the output which makes sense to me:

--- a_file.txt Fri Feb 1 13:30:39 2013 +++ b_file.txt Fri Feb 1 13:30:55 2013 @@ -1,6 +1,4 @@ -a_file.txt sample: +b_file.txt sample: http://www.ok.com/test_www.pdf -http://www.ok.com/test_1234.html http://www.ok.com/test_part.pdf http://www.ok.com/test_345.pdf -http://www.ok.com/test_error.html


Comment on Re: Compare two txt files and print the difference between the two files.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016599]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-12-27 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls