Solved

WinMerge

Posted on 2009-05-04
7
878 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unable to insert second line output line in ODBC connection 4 32
Oracle Subquery bad Join 11 46
SQL query 4 31
Java Loop 4 22
A short article about problems I had with the new location API and permissions in Marshmallow
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

746 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

11 Experts available now in Live!

Get 1:1 Help Now