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

Nicramus picture Nicramus · Feb 27, 2015 · Viewed 28.1k times · Source

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 :-)

Answer

Clément picture Clément · Feb 20, 2018

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.