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

相关推荐
int WINGsssss19 小时前
Git使用
git
用户07605303543821 小时前
Git Revert:安全移除错误提交的方式
git
bin91531 天前
【EXCEL数据处理】000017 案例 Match和Index函数。
excel
shandianchengzi1 天前
【记录】Excel|Excel 打印成 PDF 页数太多怎么办
pdf·excel
bin91531 天前
【EXCEL数据处理】000010 案列 EXCEL文本型和常规型转换。使用的软件是微软的Excel操作的。处理数据的目的是让数据更直观的显示出来,方便查看。
大数据·数据库·信息可视化·数据挖掘·数据分析·excel·数据可视化
Good_Starry1 天前
Git介绍--github/gitee/gitlab使用
git·gitee·gitlab·github
一个散步者的梦1 天前
Excel常用函数
excel
云端奇趣2 天前
探索 3 个有趣的 GitHub 学习资源库
经验分享·git·学习·github
F_D_Z2 天前
【解决办法】git clone报错unable to access ‘xxx‘: SSL certificate problem:
网络·git·网络协议·ssl
bin91532 天前
【EXCEL数据处理】000009 案列 EXCEL单元格数字格式。文本型数字格式和常规型数字格式的区别
大数据·前端·数据库·信息可视化·数据分析·excel·数据可视化