Hey Aaron, Please I need your help in getting BC automized, can u please share me code how to use BC to compare files and save the result to a file programmatically ?..
compare files and save the result to a file
Collapse
X
-
Here's an example script to compare two files and output comparison results as HTML.
file-report layout:side-by-side output-to:c:\report.html output-options:html-color c:\file1.txt c:\file2.txt
To run the script, use the command line:
"c:\program files (x86)\beyond compare 3\bcompare.exe" "@c:\script.txt"
The @ character makes Beyond Compare run a file as a script rather than load it for interactive comparison.Chris K Scooter Software -
I want to run this script using java so do I need to make use of Process.execute to create process for running the scripts??
Also i want to know what are file1.txt and file2.txt, is it some BC internal scripts or files that are to be compared??Comment
-
Hello,
Scripting documentation is available in the Help file in the Using Beyond Compare -> Scripting Reference chapter.
The core call is:
bcompare.exe "@c:\bcscript.txt"
Where bcscript.txt is:
file-report layout:side-by-side output-to:c:\report.html output-options:html-color c:\file1.txt c:\file2.txt
If you add on additional text after this call, they are parameters can be passed in as variables. This way, you can make calls from the command line without editing the script file. Like a .bat file, the variables are referenced with %1, %2, %3, etc within scripting.
bcompare.exe "@c:\bcscript.txt" "c:\file1.txt" "c:\file2.txt"
where this bcscript.txt is:
file-report layout:side-by-side output-to:c:\report.html output-options:html-color "%1" "%2"Aaron P Scooter SoftwareComment
-
Hello,
The command line would be the same:
bcompare "@c:\bcscript.txt" "c:\file1" "c:\file2"
It would be up to your program to create the file name paths (file1 and file2) and pass them as text to the command line, calling bcompare.exe and @script.txt with the file paths as parameters.Aaron P Scooter SoftwareComment
-
Hello,
Assuming a text report:
text-report layout:side-by-side options:display-mismatches output-to:c:\report.html output-options:html-color "c:\file1.txt" "c:\file2.txt"
Scripting documentation is also found in the BC4 Help file (F1) -> Using Beyond Compare, Automating with Script chapter, or in the main Scripting Reference chapter.Aaron P Scooter SoftwareComment
-
Hello,
Sorry, I was out sick from the office. You can load a .tar as a target folder.
In the graphical interface, start a new Folder Compare, and pick your two base folder targets using the Browse button or Drag and Drop from Windows Explorer. Once the paths are loaded and the comparison looks as you expect, you can copy/paste these paths out of the graphical interface and into script.txt. For example:
load "c:\path1\folder" "c:\path2\archive.tar"
expand all
folder-report layout:side-by-side output-to:"c:\reports\bcreport.html" output-options:html-colorAaron P Scooter SoftwareComment
-
The report files shows all the files that are compared. I want to display only that file which has some differences.
log verbose logfile%date%.txt
criteria rules-based
load "%1" "%2"
expand all
select diff.files orphan.files
file-report layout:side-by-side options:ignore-unimportant,display-mismatches output-to:C:\Desktop\folderreport.html output-options:html-color
This script shows all the files being compared. I even tried using select all.diff it wont work.
Please help. Urgent help needed.Comment
Comment