介绍一款小巧的Excel比对工具-DiffExcel

【缘起:此前找了一通,没有找到免费又好用的Excel比对工具,而ExcelBDD需要把Excel文件存放到Git,因此迫切需要Excel比对工具。

最新升级到V1.3.3,因为git diff有变化,原来是git diff会修改文件名,现在不改了,导致老版DiffExcel失效】

DiffExcel is an open-source and text-based tool to compare Excel, it supports Git diff.

It looks like the below:

Pre-Requirement

  • Microsoft Excel
  • PowerShell, which is pre-installed in Windows10 and the later

Install

  1. Open PowerShell
  2. execute Install-Script -Name DiffExcel
    2.1 if updating, execute Update-Script -Name DiffExcel

Direct Usage

In PowerShell, use below syntax:

DiffExcel OldExcelFilePath NewExcelFilePath

e.g. DiffExcel E:\Code\ExcelBDD\DiffExcel\Test\OldFile.xlsx E:\Code\ExcelBDD\DiffExcel\Test\NewFile.xlsx

DiffExcel OldExcelFilePath NewExcelFilePath -Open

-Open: if Open switch is set, the new Excel file will open if any change is found.

Config Git Diff

Prepare a Diff bat file

复制代码
PowerShell -ExecutionPolicy Unrestricted -Command DiffExcel %2 %5

save this bat file to somewhere on your computer, e.g. E:/Code/ExcelBDD/DiffExcel/DiffExcel.bat

if the changed file is wanted open for further check after diff, use the below command.

复制代码
PowerShell -ExecutionPolicy Unrestricted -Command DiffExcel %2 %5 -Open

Set .git/config

add or edit the .git/config file in your repository or your global and amend the following:

复制代码
[diff "excel"]
	command = E:/Code/ExcelBDD/DiffExcel/DiffExcel.bat

Set .gitattributes

复制代码
*.xls* diff=excel

Git Diff Usage

Totally the same as usual git diff, e.g.

复制代码
git status
git diff theChangedExcelFile

Other Output Example

Changed Cells

The -Open is set, the it reminds "The new file is open, please check."

New Worksheet

Missing Worksheet

相关推荐
寺中人13 小时前
Xshell 完全入门指南:从安装到实战,远程连接+文件传输+会话管理全拆解
git·ssh·github·php·远程连接·xshell·运维工具
酬谢神明则必安14 小时前
git学习记录01
linux·git·学习
lingchen190614 小时前
版本控制 Git源代码项目管理
git
虫无涯14 小时前
Coverity 如何结合 GJB8114-2013使用?
git·单元测试·嵌入式测试·coverity·静态扫描
开开心心就好15 小时前
办公软件卸载不干净?专用工具一键清残留
java·前端·人工智能·智能手机·kafka·excel·memcache
全速向光15 小时前
Excel函数系列09:公式又长又乱?LET+LAMBDA+MAP+REDUCE,自定义函数一次讲透
excel
鲲穹AI种草16 小时前
办公表格批量处理:多款 Excel 工具能力客观记录
excel
开开心心就好17 小时前
二维码批量生成导出工具,离线可用完全免费
java·前端·人工智能·智能手机·github·excel·visual studio
喵本喵叁肆18 小时前
Git 深度解读:从对象模型到分支指针,把版本控制的内核讲透
git
泡海椒1 天前
JQuick-Excel FORMAT 导出格式实战:日期、金额显示与 TRANSFORM 的边界
前端·python·excel