Generating HTML only when differences exist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jeannot
    New User
    • Apr 2013
    • 2

    Generating HTML only when differences exist

    Hello,


    Could you, please, help me ?

    Indeed, I use the following script in order to compare files:

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

    By calling it like this

    BCompare.exe @"compare_file_script.txt" "file1.txt" "file2.txt" "REPORT.html"

    I would like to know if it is possible to not generate the report if the files are identic ?

    Thanks in advance

    Best Regards

    Jeannot
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    It is not possible using only BCScript. A bcompare.exe "@script.txt" will always generate the report.

    You could create a wrapper around this script call using another scripting language (like a bat file) to check the comparison of the two files, and then only call the BCScript if the files are different.

    Within the overall script file, you can setup a call to:
    bcomp.com /qc "file1.txt" "file2.txt"

    which would return an ErrorLevel. Check this error level and skip the script call if it returns 1 or 2. You can see a full list of ErrorLevel values in our Help file -> Command Line Reference chapter, at the very bottom of the chapter.
    Aaron P Scooter Software

    Comment

    • Jeannot
      New User
      • Apr 2013
      • 2

      #3
      Hello,

      thanks for you answer !!!

      Best regards

      jeannot

      Comment

      Working...