Solved

WinMerge

Posted on 2009-05-04
7
886 Views
Last Modified: 2013-11-13
Hello,
I am using WinMerge, and while it is a descent tool, it does not match a pattern with the second occurance of the pattern.  Or at least I could not see how to do so.
My question is; Can one configure/setup WinMerge to line up with the second or third occurance of a given pattern.  
0
Comment
Question by:chima
  • 4
  • 3
7 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24311779
not sure if I understand your question. Can you show your current configuration/patterns and can you show what output you are expecting?
0
 

Author Comment

by:chima
ID: 24316872
abel, thank you for the response.  Allow me to try to explain my situation better.  When I compare two files, the left file has this pattern at line 14;        
<MyInfo>
          <MyId>305978</MyId>
On the compared file, the right side file, it matches up with
<MyInfo>
<MyId>222222</MyId>
But the Id is not a correct match, which is true and WinMerge correctly indicates that.  On the right side file, there is another, and the correct <MyInfo> <MyId>222222</MyId> "down in line 2010099" !  Ouch!
I tried adding blank lines to the right side file, to push the <MyInfo> <MyId>222222</MyId> down to the correct line, but that was "not smart."  So what I need is for WinMerge to ignore the first potential match and continue downward to the correct match.  It is as if I have to set WinMerge to match on two consecutive lines before it counts it as a mismatch.  Or to ignore the first possible match and line up with the second possible match.  Or WinMerge should take <MyId>222222</MyId> and compare it with the rest of the file to see if there is a match further down the file.
WinMerge is an OpenSource, as we know, maybe I should go to its web site and submit this suggestion, better yet get the code and fit it....right!
Maybe there is a setup for this?
0
 

Author Comment

by:chima
ID: 24316888
I also searched for a "Plugin" that might do the trick, but I have not found one.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24318419
It looks to me that you are comparing XML files with each other. There are many ways of doing this, and XML can be written quite differently and still have the same semantic content, depending on the XML schema and/or interpretation.

Depending on the structure of your XML you can do a couple of things. For instance, you can use a simple XSLT transformation to order both XML files by this MyId field and compare it thereafter. But this may not help enough.

If it is just about whether or not a certain field (based on an Xpath for instance) is in one file or not, you can also use XSLT with document() functions to compare two files. The problem with this approach is: you need to learn a bit of XSLT.

A third option is to go for an XML compare tool. There's the excellent XmlDiff (if I have the name correctly) which is from Altova. I am not a fan of their products, they are hardly compliant, if at all, but the XmlDiff received quite some praise. There are however many other XML compare tools, both open source/freeware and commercial ware.

All in all, the approach by using this WinMerge for it may not be the right choice for this task.

-- Abel --
0
 

Author Comment

by:chima
ID: 24326139
Abel, I agree with your statement that WinMerge may not be the best tool or approach, yet for the moment this is all I have to work with.  Using XSLT would be my choice, once the automation phase gets underway.  I will look into XmlDiff.  I have also been using AJCDiff and it compares my large files much more accurate than WinMerge.
0
 

Author Closing Comment

by:chima
ID: 31577796
thanks
0
 
LVL 39

Expert Comment

by:abel
ID: 24328252
you're welcome

So, what was it your went for in the end? Was AJCDIff a good choice?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

914 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now