Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2018
    Posts
    5

    Default Scripting comparison of 2 files save only when different

    Having an issue when I process multiple file compares that the script I am using is creating an html file for all comparisons whether there are differences or not.

    How do you just output to file when there is a difference?

    text-report layout:side-by-side &
    options:ignore-unimportant,display-mismatches &
    output-to:%3 output-options:html-color %1 %2

    Thanks in advance

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,893

    Default

    Hello,

    The script itself does not have this built in: the script command will always generate the report. You can put a bat file wrapper around the call to the @script, to only trigger if there is a difference detected between the files. This could use:
    bcomp.com /quickcompare "c:\file1" "c:\file2"
    which would return an %ErrorLevel%, which can be checked if the files are equal or different, then either call to script or not.

    Or, you can generate the report either way (equal or unequal), then parse/scan it to determine if it is empty, then delete it, with an external script solution.
    Aaron P Scooter Software

  3. #3
    Join Date
    Jan 2018
    Posts
    5

    Default

    Quote Originally Posted by Aaron View Post
    Hello,

    The script itself does not have this built in: the script command will always generate the report. You can put a bat file wrapper around the call to the @script, to only trigger if there is a difference detected between the files. This could use:
    bcomp.com /quickcompare "c:\file1" "c:\file2"
    which would return an %ErrorLevel%, which can be checked if the files are equal or different, then either call to script or not.

    Or, you can generate the report either way (equal or unequal), then parse/scan it to determine if it is empty, then delete it, with an external script solution.
    Got it..
    Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •