文档章节

Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告

ghou-靠墙哭
 ghou-靠墙哭
发布于 2017/05/15 15:59
字数 1132
阅读 243
收藏 0

BComp.exe /silent /closescript /solo @E:\compareTest\BCbatch.txt

text-report layout:side-by-side options:display-all,line-numbers title:"report" output-to:"E:\compareTest\report.htm" output-options:wrap-word,html-color "E:\Edit1" "E:\Edit2"

http://html5.codemach.com/beyondcompare-jiao-ben-bi-jiao-wen-jian-bing-sheng-cheng-html-ge-shi-de-cha-yi-bao-gao.html

说明:以下内容在Windows环境下验证OK

1、将Beyond Compare的安装路径添加到环境变量,以便在命令行中运行BCompare.exe命令

 

2、新建一个文本文件diff_to_html.txt,输入并保存以下内容:

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


3、在命令行中,运行以下命令:

> BCompare.exe /silent @diff_to_html.txt my_file.txt your_file.txt my_report.html

注意:这里假设*.txt、*.html都在当前工作目录中;其他情况下,请在文件名前加上相应的路径前缀Beyond Compare脚本:比较文件并生成html格式的差异报告

--------------------------------------------------------------------------------------------------------------------------------------------------

新建一个文本文件,假设命名为BCbatch.txt,只有一行内容如下:

file-report layout:side-by-side options:display-all,line-numbers output-to:"report.htm" output-options:wrap-word,html-color "比较文件1的全路径" "比较文件2的全路径"

然后在命令行下执行:

BC.exe @BCbatch.txt

 

http://www.scootersoftware.com/help/index.html?command_line_reference.html

Command Line Reference

 

Command Line Parameters

Notice that each parameter should be enclosed in quotation marks if it might contain a space.

 Note  Linux users should use "bcompare" instead of "BCompare.exe".

Parameter

Meaning

Named Session

Opens the specified session in the appropriate view.  For example:

 BCompare.exe "My Session"

Named Workspace

Opens the specified saved workspace.  (see also Managing Workspaces)  For example:

 BCompare.exe "My Special Workspace"

Pair of folders

Opens a new Folder Compare view with the specified base folders.  For example:

 BCompare.exe "C:\Left Folder" "C:\Right Folder"

Pair of files

Opens the specified files in the associated file view.  For example:

 BCompare.exe "C:\Left File.ext" "C:\Right File.ext"

3 files 

Opens a Text Merge view with the specified files in the left, right, and center panes.  For example:

 BCompare.exe C:\Left.ext C:\Right.ext C:\Center.ext

4 files 

Opens a Text Merge view with the specified files in the left, right, center, and output panes.  For example:

 BCompare.exe C:\Left.ext C:\Right.ext C:\Center.ext C:\Output.ext

Script file

Automatically executes a list of commands without using a view.  For example:

 BCompare.exe "@C:\My Script.txt"

-

Opens stdin in the appropriate view.  For example:

 dir | BCompare.exe -

Command Line Switches

 Note  Linux users should prefix the switches with "-" instead of "/".

Switch

Meaning

/?

Displays the command line documentation.

/automerge 

Automatically merges files without user interaction unless conflicts are found.

/bds <filename>

Prompts to compare against previous revisions available in the CodeGear RAD Studio/Borland Developer Studio "__history" folders.  Add to the IDE Tools menu with "/BDS $SAVE $EDNAME" as the parameters, or use the Beyond Compare IDE Expert from JED Software, available at www.jed-software.com.

/closescript

Closes the script window on completion.  Overrides the Close when finished setting in Tools > Options > Scripts.

/edit

Opens a Text Edit view.

/expandall

Expands all subfolders during the initial folder comparison.

/favorleft

/favorright 

Draws non-conflicting changes in the output from the "favored" side without coloring or section lines.  For ignored unimportant conflicts, changes are automatically taken from the "favored" side instead of the center.

/filters=<file masks>

Uses the specified name filter for the initial folder comparison.  Separate multiple file masks with semi-colons.  Surround the name filter with quotes if it contains spaces.

/force 

Writes conflicts to the output with CVS-style markers if/automerge is present.

/fv=<type>, /fileviewer=<type>

Opens a new view of the specified type which can be any of:

   "Text Compare"

   "Text Merge"

   "Data Compare"

   "Hex Compare"

   "MP3 Compare"

   "Picture Compare"

   "Registry Compare"

   "Version Compare"

/iu, /ignoreunimportant

Turns on Ignore Unimportant Differences if /automerge is present.

/mergeoutput=<filename> 

Explicitly specifies the merge output file.

/nobackups

Prevents the creation of backup files.

/qc=<type>, /quickcompare=<type>

Performs a quick comparison of two files and sets the DOS error level on exit.  The specified type can be size, crc, or binary.  If a type is not specified, a rules-based comparison will be performed.  Error levels are documented below.

/reviewconflicts 

Opens a Text Merge view if /automerge is present and conflicts are found.

/ro, /readonly

Disables editing on all sides.

/ro1, /lro, /leftreadonly

/ro2, /rro, /rightreadonly

Disables editing on the respective side.

/savetarget=<filename>

Overwrites the specified file instead of original file when the file view's Save command is used.

/silent

Causes a script to be processed invisibly, bypassing the Task Bar entry and Scripting Status window.  All interaction will be suppressed, so any unresolved issue that would normally show a dialog will log an error instead.

/solo

Forces a new instance of the program.

/sync

Opens a Folder Sync view.

/title1=<title>, /lefttitle=<title>

/title2=<title>, /righttitle=<title>

/title3=<title>, /centertitle=<title>

/title4=<title>, /outputtitle=<title>

Shows the specified description in the respective path edit.

/vcs1=<path>, /vcsleft=<path>

/vcs2=<path>, /vcsright=<path>

/vcs3=<path>, /vcscenter=<path>

/vcs4=<path>, /vcsoutput=<path>

Shows the specified version control system path in the respective path edit unless a title has been provided.  For a file view, the specified path is also used to pick the appropriate file format.

DOS Error Levels set on exit

Level

Meaning

0

Success

1

Binary same

2

Rules-based same

11

Binary differences

12

Similar

13

Rules-based differences

14

Conflicts detected

100

Unknown error

101

Conflicts detected, merge output not written

102

BComp.exe unable to wait until BCompare.exe finishes

103

BComp.exe cannot find BCompare.exe

104

Trial period expired

105

Error loading script file

106

Script syntax error

107

Script failed to load folders or files

Command Line Executable Files 

Executable

Meaning

BCompare.exe

This is the main application.  Only one copy will run at a time, regardless of how many windows you have open.  If you launch a second copy it will tell the existing copy to start a comparison and exit immediately.

BComp.exe

This is a Win32 GUI program.  If launched from a version control system, it should work just fine.  If launched from a console window, the console (or batch file) will not wait for it.

BComp.com

This is a Win32 console program.  It has to have a console.  If you launch it from one (or a batch file) that console will wait for the comparison to complete before returning.  If you launch it from a version control system interactively, it will show a console window while it's waiting.

 

本文转载自:

ghou-靠墙哭
粉丝 0
博文 85
码字总数 44234
作品 0
海淀
私信 提问
Beyond CompareMP3比较菜单的作用是什么

Beyond Compare的功能在文件比较工具中算非常强大的呢,其使用范围非常的广,不仅可以对文本,程序代码,图片等文件进行比较,甚至还可以对MP3文件进行比对从而找出其中的差异部分。接下来就...

Navicat数据库管理工具
2016/07/12
5
0
详解补丁文件在Beyond Compare中的生成操作

作为站长代码修改是必须要做的功课,在多次修改代码过程中,代码差异的问题就会出现,Beyond Compare是一款实用的代码比较软件。并且Beyond Compare软件在比较代码差异的同时,也可以生成补丁...

学术研究软件
2016/06/17
12
0
简述Beyond Compare复制文件的三种方式

Beyond Compare作为一款文件对比工具,其操作界面简洁操作简单。在使用过程中可以很快的帮助用户找到需要对比的文件差异的部分,因此,深受广大用户朋友的好评。在文件夹比较中,可以通过复制...

Navicat数据库管理工具
2016/06/16
37
0
在 Linux 下将 PNG 和 JPG 批量互转的四种方法

导读 计算机术语中,批处理指的是用一个非交互式的程序来执行一序列的任务的方法。这篇教程里,我们会使用 Linux 命令行工具,并提供 4 种简单的处理方式来把一些.PNG格式的图像批量转换成....

linux小陶
2016/12/16
2
0
程序员常会用到的软件有哪些

巧妇难为无米之炊,再牛逼的程序员也离不开编码软件来协助,那么刚入行的程序小白的疑问来了:优秀程序员的电脑里面都安装了啥呢?别着急,今天为你彻底扒拉扒拉程序大牛装机必备的软件。需要...

Navicat数据库管理工具
2016/06/06
164
0

没有更多内容

加载失败,请刷新页面

加载更多

计算机实现原理专题--二进制减法器(二)

在计算机实现原理专题--二进制减法器(一)中说明了基本原理,现准备说明如何来实现。 首先第一步255-b运算相当于对b进行按位取反,因此可将8个非门组成如下图的形式: 由于每次做减法时,我...

FAT_mt
今天
5
0
好程序员大数据学习路线分享函数+map映射+元祖

好程序员大数据学习路线分享函数+map映射+元祖,大数据各个平台上的语言实现 hadoop 由java实现,2003年至今,三大块:数据处理,数据存储,数据计算 存储: hbase --> 数据成表 处理: hive --> 数...

好程序员官方
今天
7
0
tabel 中含有复选框的列 数据理解

1、el-ui中实现某一列为复选框 实现多选非常简单: 手动添加一个el-table-column,设type属性为selction即可; 2、@selection-change事件:选项发生勾选状态变化时触发该事件 <el-table @sel...

everthing
今天
6
0
【技术分享】TestFlight测试的流程文档

上架基本需求资料 1、苹果开发者账号(如还没账号先申请-苹果开发者账号申请教程) 2、开发好的APP 通过本篇教程,可以学习到ios证书申请和打包ipa上传到appstoreconnect.apple.com进行TestF...

qtb999
今天
10
0
再见 Spring Boot 1.X,Spring Boot 2.X 走向舞台中心

2019年8月6日,Spring 官方在其博客宣布,Spring Boot 1.x 停止维护,Spring Boot 1.x 生命周期正式结束。 其实早在2018年7月30号,Spring 官方就已经在博客进行过预告,Spring Boot 1.X 将维...

Java技术剑
今天
18
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部