【问题标题】:Beyond Compare command line script for folder comparison to generate results for both folder and files inside the folderBeyond Compare 用于文件夹比较的命令行脚本,为文件夹和文件夹内的文件生成结果
【发布时间】:2016-08-03 11:00:48
【问题描述】:

这是我想要做的:

使用 Beyond compare 命令行脚本来比较 2 个文件夹,我需要文件夹级别的结果以及单个文件报告(html)

我使用了以下命令。

load "D:\Reporting\Report1" "D:\Reporting\Report2"
expand all
select all
#compare binary
folder-report layout:side-by-side output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

以上脚本保存为bcscriptFolderComparison.txt 然后我执行下面的命令

"D:\Tools\BeyondCompare\Beyond Compare 4\BCompare.exe" @D:\Tools\BeyondCompare\Commands\bcscriptFolderComparison.txt

这给出了一个并排布局的文件夹比较 html 报告。 这没关系。 我还需要用于单个文件比较的 html 报告。 (因此,如果我单击文件夹视图中的任何文件,它会显示文件比较详细信息。就像在 Beyond Compare UI 上发生的那样)

我尝试将脚本更改为:

load "D:\Reporting\Report1" "D:\Reporting\Report2"
    expand all
    select all.files
    #compare binary
    file-report layout:side-by-side output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

但这不会创建文件夹级别的视图。

我有一个选择是编写一个脚本,它首先传递文件夹位置并如上所述进行文件夹级别比较,然后进入两个文件夹并一个一个地占用文件名并运行此命令:

text-report layout:side-by-side  options:line-numbers &
output-to:"%3" &
output-options:html-color "%1" "%2"

这将保存 bcscript.txt 然后执行:

BCompare.exe @bcscript.txt  f:\file1.csv  f:\file2.csv f:\file1and2compare.html

这里 file1 和 file2 将被一个自定义脚本顺序替换,以便一个接一个地提供文件夹中的所有可用文件。

Beyond Compare 命令行是否有直接/更好的方法来做到这一点。

【问题讨论】:

    标签: command-line beyondcompare


    【解决方案1】:

    使用 folder-report 选项 include-file-links 生成 HTML 文件夹报告,其中包含指向每对文件的文件报告的链接。

    Beyond Compare 4 的脚本:

    criteria rules-based
    load "D:\Reporting\Report1" "D:\Reporting\Report2"
    expand all
    folder-report layout:side-by-side options:include-file-links output-to:"D:\Reporting\Results\compare1.html" output-options:html-color    
    

    注意:include-file-links 是在 Beyond Compare 4 中添加的。如果您运行的是旧版本,则必须使用 folder-report 生成两个单独的报告file-report 命令。

    【讨论】:

    • 感谢您的回答。它有帮助。这是为我完成这项工作的确切命令。 Load "D:\Reporting\Report1" "D:\Reporting\Report2" expand all select all compare 基于规则的 folder-report layout:side-by-side options:display-all,include-file-links output to:"D:\Reporting\Results\compare_folder_file.html" output-options:html-color
    猜你喜欢
    • 2014-05-22
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-26
    • 1970-01-01
    相关资源
    最近更新 更多