How to ignore line breaks?
Asked Answered
K

3

12

I have it ignoring unimportant differences, but I want the below to not show as a difference..

3.  TITLE

blah blah blah blah blah blah blah blah blah blah

3.  TITLE
blah blah blah
blah blah blah
blah blah blah blah
Keturahkeung answered 10/4, 2012 at 16:20 Comment(0)
C
7

That's probably not possible. I just screwed around with grammar rules for about 30 minutes and even if you're ignoring line breaks, it won't treat the non-ignored text on separate lines as being continuous across line breaks.

Effectively what you are asking the comparer to do is strip all line breaks out of the documents and compare the two documents as though each were just a single (long) line of text. You could do this manually for purposes of detecting changes, but you wouldn't be able to merge changes in this way.

Cosenza answered 10/4, 2012 at 16:44 Comment(1)
I feared that. Thanks anyway!Keturahkeung
H
1

I was also hoping that beyond compare would have something like this built in. Looks like it doesn't.

The best solution I have found to do this is to use some kind of code formatter on both sides. This allows you to compare real changes in the code. For javascript, I use JSBeautify.

For Java you could probably use your editor's built in beautifier or something like this: http://prettyprinter.de/

Hypethral answered 2/9, 2014 at 14:37 Comment(0)
M
1

I found Compare++ can compare code, ignoring linefeeds, whitespace and comment differences. http://cmpp.coodesoft.com/main/downloads

Mealworm answered 29/7, 2016 at 0:18 Comment(3)
Unfortunately Compare++ doesn't support PDFs or Word docx file formats, while Beyond Compare does. BC doesn't support ignoring linefeeds it seems, even years after they say it's on their wishlist (that list must be long by now).Velum
Compare++ is no longer available for download since 2019.Dovev
Just what I needed! I failed to find a way in Beyond Compare. After your tip here I downloaded Compare++ from archive.org web.archive.org/web/20181221013311/http://coodesoft.com . The setting to ignore crlf (and other formatting) is in a menu called "Smart". In the Smart meny I chose "Ignore...", and checked "Ignore formatting changes"...Vietnamese

© 2022 - 2024 — McMap. All rights reserved.