如何比较两个文件的内容 [英] How to Compare Contents of Two Files

查看:80
本文介绍了如何比较两个文件的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何比较两个ArrayLists的内容?我想比较它们,看看它们是否匹配。你有一个例子,或者你能指出我正确的方向吗?我知道我需要用if语句循环遍历它for循环以某种方式或两者,但我不知道如何。感谢您提供的任何帮助 -

Does anyone know how to compare contents of two ArrayLists? I want to compare them to see if they match up. Do you have an example or could you point me in the right direction. I know I need to loop through it with an if statement a for loop somehow or both, but I am not sure how. thanks for any help you can provide-

推荐答案


有谁知道如何比较两个ArrayLists的内容?我想比较它们,看看它们是否匹配。你有一个例子,或者你能指出我正确的方向吗?我知道我需要用if语句循环遍历它for循环以某种方式或两者,但我不知道如何。感谢您提供的任何帮助 -
Does anyone know how to compare contents of two ArrayLists? I want to compare them to see if they match up. Do you have an example or could you point me in the right direction. I know I need to loop through it with an if statement a for loop somehow or both, but I am not sure how. thanks for any help you can provide-



ArrayList中的对象是可比较的,对吗?

当你说想要查看是否他们匹配你的意思是如果它们在相同的位置包含相同的对象,对吧?


那么一个通过ArrayLists的简单循环应该这样做。

The objects in the ArrayList are Comparable, right?
When you say you want to see if they "match up" you mean if they contain equal objects at the same locations, right?

Then a simple loop going through the ArrayLists should do it.


它并不那么简单。我试图比较两个单独的文档,并找出更改的位置。我想通过某种类型的循环来找到一个与另一个相比较的变化。内容可以四处移动。
It is not that simple. I am trying to compare two separate documents, and find where the changes were made. I want to go through some type of loop to find the changes made on one comparred to the other. The contents may be moved all around.



这不是那么简单。我试图比较两个单独的文档,并找出更改的位置。我想通过某种类型的循环来找到一个与另一个相比较的变化。内容可以四处移动。
It is not that simple. I am trying to compare two separate documents, and find where the changes were made. I want to go through some type of loop to find the changes made on one comparred to the other. The contents may be moved all around.



这不是你在原帖中说的那样吗?那么这些文件是什么类型的? .txt,.odt,e.t.c?

That is not what you said in your original post is it? So these documents are what type? .txt, .odt, e.t.c?


这篇关于如何比较两个文件的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆