问题描述
我们的源代码存储库中有很多电子表格 (xls).这些通常使用 gnumeric 或 openoffice.org 进行编辑,并且主要用于填充数据库以使用 dbUnit 进行单元测试.据我所知,没有简单的方法可以对 xls 文件进行差异处理,这使得合并非常乏味且容易出错.
We have a lot of spreadsheets (xls) in our source code repository. These are usually edited with gnumeric or openoffice.org, and are mostly used to populate databases for unit testing with dbUnit. There are no easy ways of doing diffs on xls files that I know of, and this makes merging extremely tedious and error prone.
我已尝试将电子表格转换为 xml 并进行常规差异,但我真的觉得这应该是最后的手段.
I've tried to converting the spreadsheets to xml and doing a regular diff, but it really feels like it should be a last resort.
我想像处理文本文件一样使用 git
执行差异(和合并).我将如何做到这一点,例如当发出 git diff
?
I'd like to perform the diffing (and merging) with git
as I do with text files. How would I do this, e.g. when issuing git diff
?
推荐答案
我们在公司遇到了完全相同的问题.我们的测试输出 excel 工作簿.二进制差异不是一种选择.所以我们推出了我们自己的简单命令行工具.查看 ExcelCompare 项目.事实上,这使我们能够很好地自动化我们的测试.非常欢迎补丁/功能请求!
We faced the exact same issue in our co. Our tests output excel workbooks. Binary diff was not an option. So we rolled out our own simple command line tool. Check out the ExcelCompare project. Infact this allows us to automate our tests quite nicely. Patches / Feature requests quite welcome!
这篇关于如何使用 git diff 创建两个电子表格的可读差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!