Automate Word Document Comparison in Busy Enterprises


Many enterprises and business situations leverage Microsoft Word documents in standardized formats, with variations in content in subsequent versions. Think of contracts or other legal documents, status reports, test results, lists of rules, and many others. These documents may even be generated through automated processes. Manually identifying and reporting changes between versions would be a cumbersome process. Altova DiffDog Server provides an efficient, automated solution.

DiffDog Server brings the file and directory comparison power of Altova DiffDog to high-performance servers, making it easy to automate Word document comparison and generate diff reports comparing files, directories, or URLs, and even Word documents (.docx) saved in MS Office versions 2007 or later.

Let’s look at a Word document comparison.

Automate Word document comparison with DiffDog Server

Once installed on a machine in the 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 Word documents 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, thus enabling multiple users to call a running DiffDog Server remotely.

You can also automate Word document comparison based on time-triggers or file/folder triggers under management by FlowForce Server, Altova’s highly-customizable workflow engine for automation of enterprise-level data integration tasks.

Let’s say we want to find the differences between two versions of an apartment lease document and create a difference report. We can use a simple command line such as:

Word document comparison command

This command executes the DiffDog Server Command Line Client, requests the comparison, stores the result in a diff report file in XML format, and specifies the Word documents to be compared.

Here the result file, viewed in XMLSpy, the best-selling XML editor for modeling, editing, transforming, and debugging XML and related technologies:

Automate Word document comparison: result with default command options

Looking at lines 10 and 13 of the result, we can see the difference flagged during comparison appears to be a change in the case of a few characters. If we are more concerned with actual text differences in the document, we can add the command –doc-ignore-case=true to ignore character case. The example below uses command abbreviations to save space:

Word document comparison command to ignore character case

The new result file only shows actual differences in text content:

Automate Word document comparison: result ignoring character case

Numerous commands are available to refine the Word document comparison and result file. You can choose to include or ignore differences in font formatting, white space, etc. DiffDog Server commands to automate Word document comparison include and expand on all the comparison preference settings in DiffDog:

Word document comparison options in DiffDog

You can set default values for DiffDog Server comparison options and many other features in a client configuration file.

Three-way Word Document Comparison

DiffDog Server also supports three-way Word document comparison. Simply add the third document name to the command line:

Automate Word document comparison of 3
files

Here is the 3-way result file:

Automate Word document comparison: result of 3-way comparison

Note that the designations of left_content, middle_content, and right_content in the result file correspond to the order of file names on the command line.

Expanded Functionality

We eliminated paths in the examples above to keep them as simple as possible. In most installations, DiffDog Server will run on a central file server and be accessed by remote clients. The files to be compared may be specified by paths to separate directories, or even accessed via Web-based URLs. For instance, you may want to compare later generations of a document to a common ancestor stored in a centralized location or even on the Web.

For security purposes, administrators can optionally configure DiffDog Server to restrict server paths accessible to clients.

For compatibility with a wide range of operating environments, DiffDog Server is available for Windows, Linux, and MacOS X platforms.

Automate Word Document Comparison

DiffDog Server integrates with comparison files created in the DiffDog desktop application. The DiffDog Server import command runs a comparison specified in a DiffDog comparison file. This allows users to repeat a comparison at a later time with all the same settings.

DiffDog Server Word can also be automated through batch scripts. For instance, DiffDog Server is perfect for automating the generation of diff reports for critical documents at a given time – every day, once a week, etc.

A DiffDog Server batch script can even be executed as a job step by FlowForce Server based on a time trigger, a change in a watched folder, or as an HTTP service.

Find out for yourself how easy and fast it is to automate Word document comparison, as well as comparison of text, binary, XML files, or entire directories and even URLs – download a fully-functional, free 30-day trial!

Tags: , , , , ,