Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WinMerge

Posted on 2009-05-04
7
Medium Priority
?
897 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 39

Accepted Solution

by:
abel earned 2000 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

Technology Partners: 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!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Starting up a Project

650 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