WinMerge

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.  
chimaAsked:
Who is Participating?
 
abelConnect With a Mentor Commented:
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
 
abelCommented:
not sure if I understand your question. Can you show your current configuration/patterns and can you show what output you are expecting?
0
 
chimaAuthor Commented:
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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
chimaAuthor Commented:
I also searched for a "Plugin" that might do the trick, but I have not found one.
0
 
chimaAuthor Commented:
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
 
chimaAuthor Commented:
thanks
0
 
abelCommented:
you're welcome

So, what was it your went for in the end? Was AJCDIff a good choice?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.