Announcement

Collapse
No announcement yet.

How to do a table comparison through the scripting interface?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to do a table comparison through the scripting interface?

    As the title suggests, I want the comparison to happen using a 'table comparison'. What do I need to modify?

    Command line:
    Code:
    BCompare.exe @script.txt
    Script.txt Contents:
    Code:
    criteria rules-based
    expand all
    load path_to_folder1 path_to_folder2
    
    expand  all
    select newer.files older.fileds diff.files
    text-report layout:side-by-side options:include-file-links display-mismatches output-to:dir1 output-options:html-color

  • #2
    Use the following script to output a report of different and orphan files:

    Code:
    criteria rules-based
    load c:\folder1 c:\folder2
    expand all
    select orphan.files diff.files
    data-report layout:side-by-side options:display-mismatches output-to:c:\report.html output-options:html-color
    To include all files instead of just orphans and different files, use "select all.files" instead of the select command listed in the above example.

    Scripting Reference: https://www.scootersoftware.com/v4he...reference.html
    Chris K Scooter Software

    Comment


    • #3
      Thank you Chris, very helpful!
      I have a few questions.
      1) Is it possible to also get the UI to open up and see these results on the UI?
      2) Is it possible through a folder comparison to get individual reports for each file compare rather than a total one?

      Comment


      • #4
        1) It isn't possible to launch the UI from a Beyond Compare script. If you want to see results in the UI, you'll have to perform the same actions interactively.

        2) It's possible to generate a single folder report that lists links to individual file reports. To generate the report, use folder-report with the include-file-links option.

        Code:
        criteria rules-based
        load c:\folder1 c:\folder2
        expand all
        folder-report layout:side-by-side options:display-mismatches,include-file-links output-to:c:\report.html output-options:html-color
        Chris K Scooter Software

        Comment


        • #5
          That's fantastic!
          On a related note, through command line, i can do:
          ...\BCompare.exe file1 file2 /fv "Table Compare"

          are there some specific parameters I can pass in:
          ...\BCompare.exe folder1 folder2 in order to not only load the folders but also begin comparing everything as tables?

          Comment


          • #6
            The command-line argument to force the Table Compare for a pair of files is /fv="Table Compare".

            It isn't possible to force the Table Compare for a pair of folders with a command-line argument. However, you can edit Beyond Compare's file formats to force the Table Compare for files matching a set of file masks.

            To define a file format:
            Open Tools > File Formats.
            Click +.
            Select Table Format.
            Enter a semicolon separated list of file masks, like "*.csv;*test.table".
            Save the format.

            When the Folder Compare runs a rules-based content comparison or file contents are displayed, the highest format in the list with a matching file mask determines how to compare or display the files.
            Chris K Scooter Software

            Comment

            Working...
            X