Way to find out comparison result through script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • varshali
    Journeyman
    • Jan 2017
    • 12

    Way to find out comparison result through script

    Hi Team,

    Is there any method or way , which would help us know the comparison result like match ,mismatch using scripts.
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Beyond Compare scripts only output comparison results as reports. See the file-report and folder-report commands in Beyond Compare's help file.

    If you want a comparison result as an exit code, use the /quickcompare or /qc command line switch. It will compare two files and output comparison results as an exit code. Exit codes are listed in the Command Line Reference topic in Beyond Compare's help file.

    Beyond Compare doesn't provide a method to compare two folders and return results as an exit code.
    Chris K Scooter Software

    Comment

    • varshali
      Journeyman
      • Jan 2017
      • 12

      #3
      Hi Chris,

      As suggested we are using qc compare command which returns the exit code.

      Just one more query ,just need to confirm the approach we are using is corret or do we need to make any more changes in it.
      Please find below the process we are doing currently.

      We are using below script for comparison and generating the recon file.

      "C:\BCompare.exe" "@C:\My Script.txt" "C:\Left File.csv" "C:\Right File.csv" "C:\Result.csv"

      Config file used is as below:

      data-report layout:interleaved &
      options:display-all,line-numbers,ignore-unimportant &
      output-to:"%3" output-options:html-color "%1" "%2"

      We are passing the file names as parameters, for starting files comparison is done successfully

      Then we are using "C:\BCompare.exe" /qc "C:\Left File.csv" "C:\Right File.csv" to generate the exit code and check match/mismatch.

      So by doing this beyond compare is called twice ,once for comparison and generating file and next during quick compare for exit code.

      So does it automatically closes the sessions each time or do we need to close it through script?

      Also please let us know if there is any other approach which we would follow for comparison and exit code.

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Everything you listed appears to be correct.

        If you run a script from the command prompt while logged in, BC will display a scripting progress window. If you don't want anything to display while the script is running, use the /silent command line switch.

        "C:\BCompare.exe" /silent "@C:\My Script.txt" "C:\Left File.csv" "C:\Right File.csv" "C:\Result.csv"
        Chris K Scooter Software

        Comment

        • varshali
          Journeyman
          • Jan 2017
          • 12

          #5
          Thanks Chris for the reply.

          Just one more question so there is no need to explicitly close the BC sessions right?Below are the commands we are executing.

          "C:\BCompare.exe" /silent "@C:\My Script.txt" "C:\Left File.csv" "C:\Right File.csv" "C:\Result.csv"

          "C:\BCompare.exe" /qc "C:\Left File.csv" "C:\Right File.csv"

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            Yes, the BC sessions close automatically when you run a script with /silent or use the /qc command line switch.
            Chris K Scooter Software

            Comment

            • varshali
              Journeyman
              • Jan 2017
              • 12

              #7
              Thanks Chris for the update

              Comment

              Working...