Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy only difference (kdiff, winmerge, any diff like tool)

Is there possibility of copy ONLY difference of two files? Like in winmerge, but, I can't find this optionenter image description here

Just like on this screen- i want to copy only 'yellow part' . Of course I can do that manually, but in big file it's not too funny :-)

like image 945
Nicramus Avatar asked Feb 27 '15 12:02

Nicramus


People also ask

What is WinMerge used for?

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

Can WinMerge compare Word documents?

For example, suppose you right-click an MS Word doc file and choose Compare (also assume that the CompareMSWordFiles plugin is available). WinMerge converts the doc file (or rather, a copy of it ) to a plain text file and opens it in the File Compare window.

Can WinMerge compare binary files?

Binary ComparisonWinMerge can detect whether files are in text or binary format. When you launch a file compare operation on binary files, WinMerge opens each file in the binary file editor.


2 Answers

WinMerge has a built-in and simple way to generate such "diff only" files, that they called "patches".

Click on "Tool", then on "Generate Patch...", and enter where you want to store the result:

enter image description here

You will obtain (for your example) the file

4,8c4,8
< HELLO WORLD
< HELLO WORLD
< HELLO WORLD
< HELLO WORLD
< HELLO WORLD
---
> 
> 
> 
> 
> 

That uses the standard, compact way of representing diff and is easy to manipulate.

like image 110
Clément Avatar answered Sep 22 '22 04:09

Clément


There is a free app called DiffMerge.

Note : The option 'Show differences only' will be disabled until you switch to the bottom tab labeled Referenced View(Files as loaded). After that you should be able to use Differences Only view.

Difference with content

Difference only

like image 41
Shiv Avatar answered Sep 23 '22 04:09

Shiv