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

相关推荐
游客5202 小时前
自动化办公-合并多个excel
开发语言·python·自动化·excel
hfxns_3 小时前
Excel无法插入新单元格怎么办?有解决方法吗?
excel
嘤嘤怪呆呆狗3 小时前
【开发问题记录】执行 git cz 报require() of ES Module…… 错误
前端·javascript·vue.js·git·vue
阳区欠11 小时前
【Linux】Linux的基础工具
linux·服务器·git·vim·gcc/g++·makefile/make·gdb/cgdb
l and16 小时前
Git 行尾换行符,导致无法进入游戏
android·git
风行男孩16 小时前
Git 中忽略文件的版本跟踪(初级方法及高级方法)
git
ziyu_jia16 小时前
【日常开发】Git Stash使用技巧
git·git stash
catmes1 天前
Git开发常用命令总结
git
大G哥1 天前
pytest自动化测试数据驱动yaml/excel/csv/json
json·excel·pytest
小奥超人1 天前
Excel粘贴复制不完整的原因以及解决方法
windows·经验分享·microsoft·excel·办公技巧