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

摘要:
B压缩机。exe/silent/closescript/solo@E:compareTestBCbatch。txttext reportlayout:并排选项:显示全部,行号stitle:“report”输出到:“E:compareTesteport.htm”输出选项:换行,html-co

BComp.exe /silent /closescript /solo @E:compareTestBCbatch.txt

text-report layout:side-by-side options:display-all,line-numbers title:"report" output-to:"E:compareTest eport.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

PreviousUpNext

Command Line Parameters

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

Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第4张 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 Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第5张

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 Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第5张

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

Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第4张 Note  Linux users should prefix the switches with "-" instead of "/".

Switch

Meaning

/?

Displays the command line documentation.

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

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 Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第5张

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 Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第5张

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=<filenameBeyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第5张

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 sizecrc, or binary.  If a type is not specified, a rules-based comparison will be performed.  Error levels are documented below.

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

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 Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告第13张

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.

免责声明:文章转载自《Beyond Compare脚本:命令行批量比较文件并生成html格式的差异报告》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Kali安装教程(VMWare)ThinkPHP6 核心分析:系统服务下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

JDBC连接SQL Server 2005 报错Connection refused: connect

com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:“Connection refused: connect。请验证连接属性,并检查 SQL Server 的实例正在主机上运行,且在此端口接受 TCP/IP 连接,还要确保防火...

windows cmd: 增强windows命令行

1. 安装clink插件使得windows cmd.exe更好用 https://github.com/mridgers/clink/releases Overview: Clink combines the native Windows shell cmd.exe with the powerful command line editing featur...

linux命令行下修改系统时间、时区

date查看时间以及时区 图a是est时区,和HONGkong时间查了一个小时。 # 保存设置$ sudo mv /etc/localtime /etc/localtime.old # 设置时区 $ sudo ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime # 这里已经改完了 # 更新...

R语言数据集合并、数据增减、不等长合并

数据选取与简单操作: which 返回一个向量中指定元素的索引 which.max 返回最大元素的索引 which.min 返回最小元素的索引 sample 随机在向量中抽取元素 subset 根据条件选取元素 sort 升序排列元素 rev 反转所有元素 order 获取排序后的索引 table 返回频数表...

在Windows下利用cmd命令行启动tomcat

1.选择开始,输入cmd,回车,或者windows+r 输入cmd的快捷键 2.命令行切换从默认盘切换到,tomcat所在盘,例如我的tomcat在D:DownloadeclipseSetapache-tomcat-8.5.30in 可以直接cd D:DownloadeclipseSetapache-tomcat-8.5.30in; 也可以的直接D:Dow...

DataSet——合二为一,合并两个数据集的数据内容

在ASP.NET中,一个数据集可以包含多个数据表,本实例要实现的是两个数据表合并到一个数据集中,即该数据集中包含原来两个数据集中的所有表。 关键技术: 通过数据集的Merge方法可以将另外一个数据集、表集合或行数组的内容合并到当前数据集中。表的主键、表名称、约束等因素都会影响合并数据集的效果。 Merge方法主要用于将指定的DataSet及其架构合并到当前...