What tool can do a visual comparison of two sections within the same file?
Asked Answered
M

4

10

Good file comparison tools were already discussed to the pain, but my problem is more exotic. Is there any visual text comparison tool (like WinMerge) that would allow me easily do visual comparison on two sections within the same file?

I have multiple configurations within vcproj file and need to maintain them. It is a pain to do this manually -- splitting windows, scrolling character-by character. On top of that xml is very verbose and takes lots of screen real-estate. I cannot believe there is no tool to do automatic file section comparison, since this sounds like a very common problem.

Please, do not offer me to use property pages, I do not want more complexity, I want less. Splitting manually into files and then comparing them is also too medieval (I am doing this now anyways).

Mythopoeic answered 12/12, 2008 at 3:37 Comment(1)
It cannot do a text comparison on two chunks of text in the same file?Needleful
P
6

I use Beyond Compare (not free, but I think a shareware version is available). You can select the same file for left and right sides, then right-click the beginning of your section on each side and select "Align Manually". This would allow you to compare two sections of the same file relatively easily.

Overall, I highly recommend the product. I haven't tried version 3, which is what they currently have on their Web site, but version 2 is a fabulous tool. A+

Pourboire answered 12/12, 2008 at 3:48 Comment(1)
Beyond Compare is a great tool and well worth the couple of bucks.Nikola
R
3

Emacs Ediff.

Raycher answered 21/6, 2010 at 8:5 Comment(1)
Specifically: M-x ediff-regions-wordwise and M-x ediff-regions-linewise. You an also use M-x compare-windows to compare the current window against 'other window' (starting from the point position in each), and leave point at the first difference between the two. Repeat to continue to the next difference. I've bound this to C-M-= for easy repetition. As each window can show the same buffer, this makes another quick way to compare two regions in the same buffer.Rotative
M
2

I use UltraEdit for most of my text editing and they have a product called UltraCompare that does a visual compare.


Update by Mofi

UltraCompare Professional supports also a comparison of text snippets in addition to entire files.

After starting UltraCompare, select Text Compare in menu Mode if not already selected. Select in text editor the first text block which should be compared, press Ctrl+C, switch back to UC and paste with Ctrl+V the block into left text area pane. Switch again to text editor, select the other block in same file, press Ctrl+C, switch back to UC, click into right pane and paste the block with Ctrl+V. The two blocks are immediately compared and the differences are displayed.

Such a text snippet comparison for two blocks in same file can be started also directly from within UltraEdit. Select the first block in file, press Ctrl+C, Ctrl+N, Ctrl+V and Ctrl+A to copy, paste and reselect this block in a new file. Select the second block in file. Execute command Compare from menu File in UltraEdit with option Compare selected text automatically being enabled and click on button Compare. UC Professional is started with just the 2 selected blocks for comparison.

Mccarthyism answered 12/12, 2008 at 3:39 Comment(3)
Does it do visual compare on sections within the same file?Mythopoeic
Doesn't look like it... I've never seen this feature on any of the many text editors I've tried out on the mac platform. It would certainly be useful though!Needleful
I've never used it for that, I don't knowMccarthyism
K
2

You can use Meld to do this

  1. Open up meld without specifying file names
  2. Meld with prompt which type of comparison you want. Choose file comparison
  3. Meld will present the the icon to select the file names. Below that it will prompt for a Blank comparison. Choose that.
    1. In the file comparison window, paste the sections of the file you want to compare.
Kolosick answered 18/10, 2015 at 18:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.