介绍一款小巧的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

相关推荐
C+++Python2 小时前
如何使用 VS Code 进行 Git 管理?
git
用户3835514240283 小时前
git 删除历史记录或历史大文件后 提交历史记录到新的仓库
git
kqz20143 小时前
主分支下某个文件夹的git记录同步到开发分支
git
开开心心_Every4 小时前
强制打字练习工具:打够百字才可退出
java·游戏·微信·eclipse·pdf·excel·语音识别
开开心心_Every4 小时前
多端免费远程控制工具:4K流畅同账号直连
游戏·macos·微信·pdf·excel·语音识别·phpstorm
午安~婉5 小时前
整理Git
前端·git
飞翔沫沫情5 小时前
关于在Jenkins 的job 中隐藏shared library 共享库相关的Git信息
运维·git·jenkins
wang6021252186 小时前
Git部署项目配置密钥-Linux系统
linux·运维·git
Knight_AL7 小时前
Git 版本回退/撤销/重置:CheckOut VS Revert VS Reset
git
jayaccc17 小时前
Git命令大全:从入门到精通
大数据·git·elasticsearch