Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#126 Support for plugins to diff various file types

open
nobody
None
5
2012-09-23
2012-01-17
Ketil Froyn
No

WinMerge has support for plugins, and for that reason it can diff pdf, doc, xls, etc. Would be nice if KDiff3 got the same or similar plugin support. If KDiff3 supports the same interface as WinMerge, plugins already written for WinMerge can even be copied and used with KDiff3 "out of the box".

Discussion

  • Joachim Eibl
    Joachim Eibl
    2012-01-18

    Hi,
    KDiff3 already has a similar feature called "Preprocessor" in the "Diff"-options.
    The winmerge plugin xdocdiffPlugin_1_0_6c.zip package contains a file xdoc2txt.exe.
    This extracts the text from files in various formats and writes plain text files.
    You can also use it with KDiff3! But you need some kind of wrapper.
    Here is an example perl-script for doc-files:

    xdoc2txt.pl

    use File::Temp qw(tempfile);
    ($fh, $filename) = tempfile( UNLINK=>1, SUFFIX => ".doc" );
    binmode STDIN;
    binmode $fh;

    print "$filename\n";

    print $fh <STDIN>;
    close($fh);
    system("c:/ut/xdoc2txt.exe $filename"); # Fix your path to xdoc2txt.exe
    $fh=0; # Delete temp file

    End of script

    In KDiff3 you can now specify the preprocessor:
    c:\<path to perl>\perl.exe c:\ut\xdoc2txt.pl
    (Again fix the path. I have the script in c:\ut.)

    Please try it and write if it works.

    I know that this is not really very comfortable yet. But this might be improved in the future. Yet it's a pity that for xdoc2txt.exe no sources are available.

    Joachim

     
  • Ketil Froyn
    Ketil Froyn
    2012-01-31

    Thanks, I'll try that!