Skip to content

Textconv filter for Excel files: get readable diffs from excel workbooks.

License

Notifications You must be signed in to change notification settings

bitterjug/excel-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel Textconv

A script to render an excel (.xlsx) workbook as text suitable to use with diff and, in particular, git diff, to get readable diffs, for example with Git. Inspired by William Usher's git_diff_xlsx which he wrote for working with the UK TIMES model (see his blog). I wrote this in Ruby (using rubyXL) because thats the language of the other UK-TIMES tools

Dependencies

Features

Options to:

  • hide formulas, and show only values (useful for regression testing)
  • hide calculated values for formulas and show just the formulas (useful for git diffs)

Install

On Linux, I create a link called xl-textconv in my ~/bin.

Use

Usage: xl-textconv [options] <workbook-file>
    -v, --no-values                  Exclude calculated values
    -f, --no-formulas                Exclude cell formulas
    -h, --help                       Show this message

Set up Git to use it

See the Git Book

Tell git that files ending xlsx are to be treated as Excel for diff: create .gitattributes file in the root of your repo with the following:

*.xlsx diff=excel

Tell Git how to diff Excel files: in .git/config:

[diff "excel"]
    binary = True
    textconv = xl-textconv -v
    cachetextconv = true

See also This node.js version with some interesting notes on use, including using cachetextconv

Caveat emptor

  • I'm not a Ruby programmer.
  • There are no tests.

About

Textconv filter for Excel files: get readable diffs from excel workbooks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages