Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by Lotus1 (Vicar)
on Feb 01, 2013 at 18:41 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1016599]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 20:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found