Can anybody tell me whether there is any facility(any class/function) in Java that I can use to compare two ascii files....??.Please treat this as urgent. Regards Alka
posted 16 years ago
What do you want the comparison to do? return a boolean (true if same, false if different)? return the index of the first difference it finds? produce some summary of the actual differences (cf 'diff')? If it is either of the first two, I recommend loading each file into a String and using String.equals() or String.compareTo(). If you need any more than that, you'll probably have to write something, or call out to an external "diff" program.