If matching for differences does not have to be done in Perl (tmtowtdi), and if you have the Vim editor, you can display the differences between up to four files. You may want to add the following "if" statement in your "_vimrc" file to make the differences stand out better.

if &diff colorscheme clarity set diffopt=filler,context:0 "context displays 0 lines before and +after lines flagged as differrent. endif

Start the Vim editor as follows:
(Note that on Windows, the "start" command frees up the command window while editing)
start /b gvim -d file1 file2

Once the diff screens are displayed, use the Vim normal mode command "zr" to display all hidden lines in both files.

Save the following text fragments to "file1" and "file2" for testing.

file1: A few moments will suffice to commit it to memory; yet the period whic +h it covers, commencing more than twenty-five centuries ago, reaches on fro +m that far-distant point past the rise and fall of kingdoms, past the setting + up and overthrow of empires, past cycles and ages, past our own day, over int +o the eternal state. file2: A few moments will suffice to commit it to memory, yet the period whic +h it covers, beginning more than twenty-five centuries ago, reaches from th +at far-distant point past the rise and fall of kingdoms, past the setting + up and overthrow of empires, past cycles and ages, past our own day, to the e +ternal state.

"It's not how hard you work, it's how much you get done."


In reply to Re: Comparing two text files and marking differences by roho
in thread Comparing two text files and marking differences by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.