Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2013
    Posts
    4

    Default how to compare multiple files?

    hi,

    I dont have much exp with BC 3 and scripting, i would like to build script to compare four files for example:

    scenario1:
    file 1: \\server1\folder1\text.txt
    file 2: \\server2\folder1\text.txt

    scenario2:
    file 3: \\server3\folder1\text.txt
    file 4: \\server4\folder1\text.txt

    ofc, I would like to have these two comparisons done in the same time.

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

    Default

    Hello,

    Would you like to generate a report comparing file1 to file2, then generate a 2nd report comparing file3 to file4?

    This can be done in scripting using the command line:
    bcompare.exe "@c:\bcscript.txt"

    Then the script file example could be:
    [CODE]
    text-report layout:side-by-side output-to:"c:bcreport1.html" output-options:html-color "\\server1\folder1\text.txt" "\\server2\folder1\text.txt"
    text-report layout:side-by-side output-to:"c:bcreport2.html" output-options:html-color "\\server3\folder1\text.txt" "\\server4\folder1\text.txt"

    Scripting actions follow the general actions you can perform in the graphical interface. Could you provide more details on the steps you are following in the interface and the reports you are generating from there? We can then help with the script to follow similar steps.
    Aaron P Scooter Software

  3. #3
    Join Date
    Jun 2013
    Posts
    4

    Default

    would it be possible to have output in one file instead of multiple files? for example:

    bcreport.html

    also, where exactly output file bcreport.html will be saved?

  4. #4
    Join Date
    Jun 2013
    Posts
    4

    Default

    also, would it be possible to note only file differences (if any)?

  5. #5
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,616

    Default

    It is not possible to have a single HTML report file for multiple text comparisons unless you open a folder compare, select the multiple files you want to compare, then generate the report. If you pass in pairs of files on the command line, we do not support appended reports together.

    Code:
    log verbose "c:\bclog.txt"
    criteria rules-based
    load "c:\folder1" "c:\folder2"
    expand all
    select diff.files
    text-report layout:side-by-side options:display-mismatches output-to:"c:\bcreport.html" output-options:html-color
    For a plain text report, you could append them together using a batch file:
    Code:
    bcompare.exe "@c:\script.txt" "c:\file1" "c:\file2"
    type tempReport.txt >> mainreport.txt
    bcompare.exe "@c:\script.txt" "c:\file3" "c:\file4"
    type tempReport.txt >> mainreport.txt
    Where script.txt is
    Code:
    text-report layout:side-by-side options:display-mismatches output-to:"c:\tempReport.txt" "%1" "%2"
    Aaron P Scooter Software

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,616

    Default

    To show only differences, add the "options:display-mismatches" parameter to the text-report command. Detailed documentation can be found in the Help file -> Scripting Reference, or in the Help file -> Using Beyond Compare -> Automating with Script chapter.
    Aaron P Scooter Software

  7. #7
    Join Date
    Jun 2013
    Posts
    4

    Default

    thank you, this was very useful!

Tags for this Thread

Posting Permissions

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