Automate Diff Report Generation


DiffDog Server makes it easy to automate high-volume comparisons and generate diff reports comparing files, directories, and URLs. This high-performance server software is available for Windows, Linux, and MacOS X machines.

Developers have long relied on DiffDog for comparing XML, text, and binary files, as well as directories and URLs. Now, the power of DiffDog is available in lightning-fast server software for easily automating large comparison tasks.

For instance, DiffDog Server is perfect to automate diff report generation for critical files and directories at a given time – every day, once a week, etc.

DiffDog Server supports the following types of comparisons:

  • Binary, text, and XML files
  • Directories (including ZIP archives)
  • URLs
  • 2-way directory comparisons and 2- or 3-way file diffs

Once installed on a machine in your network, DiffDog Server runs as a service. You can run comparisons by invoking DiffDog Server either from the command line interface or through executable scripts.

You can compare files either directly on the server machine where DiffDog Server is installed, or call a comparison remotely from a client machine. The DiffDog Server installation includes a portable DiffDog Command Line Client, which can be copied to multiple machines within your organization, thus enabling users to call a running DiffDog Server remotely.

Let’s start with a simple directory comparison using the DiffDog Server Command Line Client. The simple form of a directory command is shown in the image below, where the diff command is modified by several options:

  • dc is short for dir-compare-contents and instructs the server to compare the contents of matching files, not just the file size and creation date
  • om=xml specifies the xml output mode, as opposed to text mode
  • o=results.xml sends the results to a file named results.xml
  • directory1 and directory2 specify the path of directories to compare

Simple example of a DiffDog Server directory comparison command

Here is the partial execution result of the DiffDog Server Command Line Client diff command to compare two directories containing XMLSpy examples from v2018 and v2017:

DiffDog Server directory comparison execution example

Showing the full comparison results in the execution window is optional, and may be unnecessary since we also directed the results to an output file in xml format. Here is a partial view of the result file as seen in XMLSpy:

Result of DiffDog Server command to automate diff report generation

In addition to direct execution, DiffDog Command Line Client instructions can be included in a batch file or other script for automated execution. And, the DiffDog Command Line Client tool can be distributed to multiple users on your network to allow them to execute commands on the server running DiffDog Server.

Integration with DiffDog

DiffDog allows users to compare and merge differences between directories or files, even three files side-by-side. This feature is especially relevant for files managed in any source control system where two users may start from the same source file then make different changes which must be reconciled. The example below shows a 3-way comparison of different versions of an XML file.

A 3-way file comparison in DiffDog

All the settings for file or folder comparisons defined in DiffDog may be saved in files for reuse. These sets of comparison instructions contain the full paths of directories or files, all DiffDog comparison options set originally, and even the name and location of the optional results file.

Once you create comparison files (such as .filedif and .dirdif files) in DiffDog, you can compare them in a server environment as well. This enables you to automate or integrate frequently-used comparisons into your custom scripts or processes.

The DiffDog Command Line Client import command simplifies creation and reuse of repetitive comparisons by importing a .filedif or .dridif file, as shown here:

DiffDog Server import command to automate diff report generation

Here is a partial view of the XML result file for the 3-way comparison shown above:

DiffDog Server file comparison diff results

So far all our examples used XML files, but DiffDog Server has many additional comparison options to automate diff report generation. DiffDog Server lets you automate diff report generation for text or source code files, XML or JSON files, and Word documents. Diff reports in text format the well-accepted Unix diff style.

The screenshot below shows a DiffDog 3-way file comparison of JSON files containing the same data as the 3-way XML file comparion above.

DiffDog 3-way comparison of JSON files

We saved these comparison settings in the file FileCompare2.filedif and executed a DiffDog Server comparison using the command: DiffDogCmdlClient import FileCompare2.filedif

We generated the result file for this comparison in text format, as seen in the partial view here:

Result file for command to automate diff result generation for JSON files

Find out for yourself how DiffDog Server can automate diff report generation on your Windows, Linux, or MacOS X servers — download a fully-functional, free 30-day trial!

(Or, if you need a desktop tool to compare and merge text or source code files, XML or JSON files, and Word documents, or compare and synchronize directories, databases, and much more, download a DiffDog free trial.)

Tags: , ,