?
Solved

Comparing text documents (originally HTML docs, but saved to text files)

Posted on 2010-01-01
10
Medium Priority
?
211 Views
Last Modified: 2012-05-08
I'm comparing two text documents with different text flows and embedded hard returns (0x0D 0x0A).

There are numerous sections where file A might read
   The quick brown fox
   jumped over the
   lazy dog
and file B might read
   The quick brown fox jumped
   over the lazy dog.

Converted to a canonical form, these two sentences are identical, but my comparison tool (Beyond Compare) shows differences due to the hard returns.

I could write something to trim the hard returns, but am hoping there is an easier way.  There will be insertions, deletions, and changes between the two files.

Any ideas?  I'm on Windows 7, have Visual Studio 2008, have Beyond Compare.
0
Comment
Question by:josgood
  • 6
  • 4
10 Comments
 
LVL 11

Expert Comment

by:ICaldwell
ID: 26159619
Use this.... http://diffuse.sourceforge.net/

There is a windows version & Linux version..... Its Free and works great
0
 
LVL 11

Expert Comment

by:ICaldwell
ID: 26159621
Here is a website showing all the different free ones if you would like to check out other ones:

http://www.thefreecountry.com/programming/filecomparison.shtml
0
 
LVL 13

Author Comment

by:josgood
ID: 26159636
Thanks for the ideas!  I'll check it/them out.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Author Comment

by:josgood
ID: 26159649
I'm running Windows, not Linux, so I don't have a ready way to handle deb files.

I'll take a look at the other link you suggested.
0
 
LVL 11

Expert Comment

by:ICaldwell
ID: 26159659
0
 
LVL 13

Author Comment

by:josgood
ID: 26159703
Thank you.  I have Diffuse installed and I'll take a look at it.
0
 
LVL 13

Author Comment

by:josgood
ID: 26159753
Well, Diffuse has the same problem as Beyond Compare...embedded hard newlines (0x0D 0x)A in Windows) are honored, even with end of line characters and whitespace ignored.

Diffuse looks like a good tool, but its not doing the job I want.
0
 
LVL 11

Accepted Solution

by:
ICaldwell earned 2000 total points
ID: 26159778
I think your going to run into this with every text comparer unless you go to a hex/binary comparison.... White Space can be checked with some programs but its default not to compare hard new lines unless your in hex/binary mode...

If you do go to Hex/Binary mode your going to have problems viewing the data the same way your use to...
0
 
LVL 13

Author Comment

by:josgood
ID: 26159804
I think you're right.  I was hoping to simply use a tool that already exists, without needing to write anything.

I appreciate your help.
0
 
LVL 13

Author Closing Comment

by:josgood
ID: 31671864
Thank you.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Being able to change email signatures is made really simple with email signature software and services.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question