http://www.perlmonks.org?node_id=1028184


in reply to Re^2: Reading concurrently two files with different number of lines
in thread Reading concurrently two files with different number of lines

diff would not understand the continuation lines, but it doesn't necessarily have to. You can break your problem into two parts, and attack them individually:

  1. Normalize your inputs
  2. Compare your inputs

The first you would do with Perl. Write a script that just handles the line continuations and normalizes your input into a "clean" format.

You could then use diff to do the actual comparison between the two files. If diff doesn't meet your requirements for some reason, your comparison code would still be cleaner and simpler for not having to deal with the line continuations.

Christopher Cashell

Replies are listed 'Best First'.
Re^4: Reading concurrently two files with different number of lines
by frogsausage (Sexton) on Apr 11, 2013 at 15:50 UTC
    Thanks for the details. In the end, I already had my line to be compared in an array, so I just ended up using string comparison.

    I gave my "solution" below following my code working great here :)