我有两个要比较的文件。这些行有时间戳,可能还有一些我想在匹配算法中忽略的其他内容,但如果匹配算法在文本的其余部分发现差异,我仍然希望输出这些项目。例如:
1c1
< [junit4] 2013-01-11 04:43:57,392 INFO com.example.MyClass:123 [main] [loadOverridePropFile] Config file application.properties not found: java.io.FileNotFoundException: /path/to/application.properties (No such file or directory)
---
> [junit4] 2013-01-11 22:16:07,398 INFO com.example.MyClass:123 [main] [loadOverridePropFile] Config file application.properties not found: java.io.FileNotFoundException: /path/to/application.properties (No such file or directory)
不应发出,但:
1c1
< [junit4] 2013-01-11 04:43:57,392 INFO com.example.MyClass:123 [main] [loadOverridePropFile] Config file application.properties not found: java.io.FileNotFoundException: /path/to/application.properties (No such file or directory)
---
> [junit4] 2013-01-11 22:16:07,398 INFO com.example.MyClass:456 [main] [loadOverridePropFile] Config file application.properties not found: java.io.FileNotFoundException: /path/to/application.properties (No such file or directory)
应该发出(因为行号不同)。请注意,仍会发出时间戳。
如何才能做到这一点?