Hi All,
I am abit rusty with my Java. Basically what im trying to do is compare the data in two text files. Basically they should match. The data in the files are separated by tabs i.e.somestring tab somestring tab etc. If they match, then program will display that they match. If they dont, then program will say that they dont match. My program is not quite correct. Can anyone help with my program as i need to get this running correctly urgently. I have had very good feedback from everyone so thanks. Speedy reply would be very much appreciated! Have a look at the my program below and edit where appropriate.
InputStream inputStream1, inputStream2 = null;
try
{
inputStream1 = new FileInputStream("C:\\file1
.txt");
inputStream2 = new FileInputStream("C:\\file2
.txt");
boolean match (InputStream inputStream1, InputStream inputStream2){
While (true){
if (inputStream1 == inputStream2){
return true;
System.out.println("Files match");
}
else{
return false;
System.out.println("Files do not match");
}
}
}
}
catch( FileNotFoundException e )
{
e.printStackTrace();
}
Start Free Trial