MissPerl has asked for the wisdom of the Perl Monks concerning the following question:
The $difference printed in html file only shows the difference - top & bottom (maybe 2 or 3 lines from 1000 lines).$a = "/path/to/a/file"; $b = "/path/to/b/file"; $difference = system("$diff $a $b"); $difference2 = system("$diff -y $a $b");
But the $difference2 printed in html file shows all the difference in 2 columns -left & right (1000 lines from 1000 lines).
The output is actually fine, since I dont want to compare line by line, as sometime one has some extra lines while the other dont,So i want those extra lines which is in a and in b at the same file same time.
Here, I am wondering if it is possible to have the sort of combination of both $diff and $diff -y, having 2 left/right columns of difference in some lines only (not showing every lines)So that, $difference will shown in 2 columns with the line of differences in file.if ($difference eq ''){ $difference = "Exactly Same.\n"; } push @table1, "<table id =\"Table1\">"; push @table1, "<tr><th>path A</th><th>A</th><th>path B</th><th>B</th>< +/tr>"; push @table1, "<tr><td colspan =\"4\">$difference</td></tr>";
Any idea guys ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: diff vs diff -y
by roboticus (Chancellor) on Oct 19, 2018 at 17:53 UTC | |
by MissPerl (Sexton) on Oct 22, 2018 at 13:29 UTC | |
by roboticus (Chancellor) on Oct 22, 2018 at 23:25 UTC | |
|
Re: diff vs diff -y
by hippo (Archbishop) on Oct 19, 2018 at 15:47 UTC | |
by MissPerl (Sexton) on Oct 22, 2018 at 13:31 UTC | |
|
Re: diff vs diff -y
by johngg (Canon) on Oct 19, 2018 at 17:52 UTC | |
by MissPerl (Sexton) on Oct 22, 2018 at 13:33 UTC | |
|
Re: diff vs diff -y
by LanX (Saint) on Oct 19, 2018 at 15:23 UTC | |
|
Re: diff vs diff -y
by Anonymous Monk on Oct 19, 2018 at 15:29 UTC | |
by MissPerl (Sexton) on Oct 22, 2018 at 13:34 UTC |