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

    1. [diff "excel"]
    2. command = E:/Code/ExcelBDD/DiffExcel/DiffExcel.bat

    Set .gitattributes

    *.xls* diff=excel
    

    Git Diff Usage

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

    1. git status
    2. 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

  • 相关阅读:
    python计算离散积分
    【WinCC动画控件 Industrial Gadgets ActiveX Pro 安装与使用】
    抖音 Android 性能优化系列:Java 锁优化
    Log4j 2.17.0 再曝漏洞,但不要惊慌
    mysql面试题33:Blob和text有什么区别
    Typora和基本的Markdown语法
    在雅加达EE服务中使用Thymeleaf
    运维排查-使用hcache插件排查Buffer/cache占用过高
    华为od-C卷200分题目2 - 找城市
    python变量名解析总结
  • 原文地址:https://blog.csdn.net/zhangmike/article/details/133815439