小编asw*_*ini的帖子

想用java找到两个文本文件之间的内容差异

我有两个文本文件,

  • A.TXT
  • b.txt

每个文本文件都包含一些文件路径.b.txt包含的文件路径比a.txt.我想确定添加哪些路径以及哪些路径被删除,a.txt以便它对应于路径b.txt.

例如,

abc.txt包含

E:\Users\Documents\hello\a.properties
E:\Users\Documents\hello\b.properties
E:\Users\Documents\hello\c.properties 
Run Code Online (Sandbox Code Playgroud)

和xyz.txt包含

E:\Users\Documents\hello\a.properties
E:\Users\Documents\hello\c.properties
E:\Users\Documents\hello\g.properties
E:\Users\Documents\hello\h.properties
Run Code Online (Sandbox Code Playgroud)

现在如何找到g.prop和h.prop被添加并删除b.prop?

任何人都可以解释它是如何完成的?我只能找到如何检查相同的内容.

java

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

java ×1