wdiff突出显示差异
如何使用WDIFF显示两个文件之间的单词差异?现在,我可以显示两个文件之间有哪些单词并打印出统计数据。我想确切地染色哪些单词不同。
#! usr/bin/bash
wdiff -si12 exp3.txt out.txt | colordiff
输出:
Input an integer greater than or equal to 0 or -1 to quit:
The largest number is 5
Goodbye!
exp3.txt: 6 words 39 100% common 0 0% deleted 0 0% changed
out.txt: 6 words 39 100% common 0 0% inserted 0 0% changed
它打印所有常用单词。我已经做到了 - 固定是要查看受支持的WDIFF命令,但我找不到如何突出显示差异。任何帮助都将受到赞赏!
How do I use wdiff to show the word differences between two files? Right now, I can show which words are in common between two files and print out the stats. I'd like to color red exactly which words are different.
#! usr/bin/bash
wdiff -si12 exp3.txt out.txt | colordiff
This outputs:
Input an integer greater than or equal to 0 or -1 to quit:
The largest number is 5
Goodbye!
exp3.txt: 6 words 39 100% common 0 0% deleted 0 0% changed
out.txt: 6 words 39 100% common 0 0% inserted 0 0% changed
It prints all the common words. I've done --help to look at the supported wdiff commands but I couldn't find how to highlight differences. Any help is appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WDIFF 手动页面建议一页添加颜色diffs的方法:
The final example on the wdiff manual page suggests a way to add color to the word diffs: