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

相关推荐
全栈陈序员38 分钟前
理解 Git 的第一步:什么是版本控制系统?
git
我的offer在哪里3 小时前
git操作遇到的问题
git
realhuizhu4 小时前
你的Git提交记录是“代码史诗”,还是“只有上帝能看懂的天书”?
git·版本控制·团队协作·ai工具·提示词工程
Mr YiRan5 小时前
Git “cherry-pick“ 命令详解和应用场景
git
娃乐呵6 小时前
免费的大批量Excel文档大模型处理数据工具
语言模型·大模型·excel·数据处理
星月心城7 小时前
git提交代码时所遇问题
大数据·git·elasticsearch
Dolphin_海豚7 小时前
到底是选 merge 还是选 rebase
git·面试·程序员
云和数据.ChenGuang8 小时前
采集Git相关日志(结合Filebeat)
大数据·git·elasticsearch
Eiceblue9 小时前
使用 Python 写入多类型数据至 Excel 文件
开发语言·python·excel
苹果电脑的鑫鑫10 小时前
git如何撤销上次上传的内容
大数据·git·elasticsearch