Solved

WinMerge

Posted on 2009-05-04
7
888 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

785 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