Created
August 13, 2019 11:01
-
-
Save yoursdearboy/f83bd0e73de424a21ba7114be762e4bb to your computer and use it in GitHub Desktop.
Compare XLSX files using [daff](http://paulfitz.github.io/daff/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[diff "xlsx"] | |
command = xlsx2daff diff | |
[diff "csv"] | |
command = daff diff --git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "${#@}" -lt 7 ] | |
then | |
echo "Expected more arguments from Git" | |
exit 1 | |
fi | |
NEW=${@: -7 : 1} | |
OLD=${@: -6 : 1} | |
REST_ARGS=${@: 0 : ${#@}-6} | |
# CSV conversion | |
NEW_CSV=$(mktemp) | |
OLD_CSV=$(mktemp) | |
xlsx2csv $NEW $NEW_CSV | |
xlsx2csv $OLD $OLD_CSV | |
# Daff | |
daff $REST_ARGS $OLD_CSV $NEW_CSV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment