0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

BeyondCompareでフォルダ比較(バッチ処理)

Last updated at Posted at 2023-11-23

概要

比較ツールとしては、winmerge がありますが、それよりも高機能で使い易い BeyondCompare でのファイル Diff、フォルダ Diff を出力するバッチ処理の方法を記載しておく。

フォルダ比較は、Google 検索でもなかなか出てこなかったが、強力な Script 言語を使うことで実現できる。

ファイル比較し結果を出力する

diff-report.bat
@echo off
"C:\program files\Beyond Compare 4\BCompare.exe" @.\bs_script.txt "C:\work\basefile.txt" "C:\work\newfile.csv" .\output\file_diff.html /silent
bs_script.txt
text-report layout:side-by-side options:line-numbers output-to:%3 output-options:wrap-word,html-color %1 %2

フォルダを比較し結果を出力する

diff-report.bat
@echo off
"C:\program files\Beyond Compare 4\BCompare.exe" "..\oldfolder" "..\newfolder" @.\bs_script_folder.txt .\folder_diff_report.html
bs_script_folder.txt
# folderの場合、folder-reportコマンドに追加で出来ないようなので、引数1(folderpath)と引数2(folderpath)をLoadしておく
load %1 %2
# ルールベースの比較を実行する
select files right.diff
compare rules-based
# フォルダレポートを出力する
folder-report layout:side-by-side options:display-mismatches,include-file-links output-to:%3 output-options:wrap-word,html-color

参考:BeyondCompare Scripting Reference

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?