Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks!
I am trying to compare two text files with a bunch of links in each line, I would like to know what is not on the second file that is on the second file. Print the difference between the two files. I am using this code but It doesn't make sense on the results I’m getting, ma someone has a better way of doing this. Here is the code I am using:
I am trying to compare two text files with a bunch of links in each line, I would like to know what is not on the second file that is on the second file. Print the difference between the two files. I am using this code but It doesn't make sense on the results I’m getting, ma someone has a better way of doing this. Here is the code I am using:
a_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
b_file.txt sample: http://www.ok.com/test_www.pdf http://www.ok.com/test_part.pdf http://www.ok.com/test_345.pdf
#!/usr/bin/perl use strict; use warnings; use Text::Diff; my $diffs = diff 'a_file.txt' => 'b_file.txt'; print $diffs;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Compare two txt files and print the difference between the two files.
by Kenosis (Priest) on Feb 01, 2013 at 18:25 UTC | |
Re: Compare two txt files and print the difference between the two files.
by trizen (Hermit) on Feb 01, 2013 at 17:06 UTC | |
by Anonymous Monk on Apr 05, 2017 at 17:45 UTC | |
Re: Compare two txt files and print the difference between the two files.
by Lotus1 (Vicar) on Feb 01, 2013 at 18:41 UTC | |
Re: Compare two txt files and print the difference between the two files.
by 7stud (Deacon) on Feb 02, 2013 at 02:33 UTC |
Back to
Seekers of Perl Wisdom