Handling the Output

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Running Comparisons >

Handling the Output

When you run a comparison, you can view the comparison result directly at the command line, or output it to a report in XML or text format. Set the --output-mode option to specify the output format. For example, the following command compares two text files using text comparison mode (that is, --mode=text) and displays the output as text at the command line:

 

DiffDogCmdlClient diff a.txt b.txt --mode=text --output-mode=text

 

To redirect the output to a file, set the --output-file option. For example, the following command compares two text files using text comparison mode (that is, --mode=text). The output report will be in XML format and it will be redirected to out.xml file:

 

DiffDogCmdlClient diff a.txt b.txt --mode=text --output-mode=xml --output-file=out.xml

 

Note:The option --output-mode=text is not supported when comparing XML files. If you set the --output-mode to text when comparing XML files, no differences will be reported in the standard output. If you additionally set the --output-file option, a zero-sized output file will be created.

 

By default, the output report containing comparison results is displayed at the command line, unless you set the option --quiet=true.

 

Binary files

When you compare files in binary mode (that is, when the option --mode=binary), DiffDog Server creates no output report, since listing differences is not meaningful for binary files. In such cases, check the %ERRORLEVEL% environment variable to view the comparison outcome.

 

Error level

Meaning

0

No differences exist

1

Differences exist

2

An error has occurred

 

For example, the following Windows batch script compares two PDF files in binary mode. The %ERRORLEVEL% environment variable outputs the comparison outcome.

 

DiffDogCmdlClient diff "C:\book1.pdf" "C:\book2.pdf" --m=binary
ECHO %ERRORLEVEL%


© 2019 Altova GmbH