Results 1 to 1 of 1
Thread: comparing the two files
- 02-21-2011, 10:27 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 22
- Rep Power
- 0
comparing the two files
Hi all,
I want to compare the line1 in file1 with all the lines in file2 .....
like dat i need to repeat for all the lines in file1
pls tell me the way how to achieve this.........
while (( cnt5= actlFileBufRdr.readLine()) != null){
s[i]=cnt5;
count++;
i++;
}
while (( cnt6= expcFileBufRdr.readLine()) != null){
s1[j]=cnt6;
count1++;
j++;
}
for(i=0;i<count;i++)
for(j=0;j<count1;j++) {
/* if(s[i]==s1[j]) {
i++; }
else
{
if(i==j) {
resultFileBufWrtr.write(s[i]);
resultFileBufWrtr.append(System.getProperty("line. separator"));
} } */
if(s[i]==s1[j])
{
s[i]="0";s1[j]="0"; i++; }
}
for(i=0;i<count;i++)
for(j=0;j<count1;j++)
{
if(i==j)
if(s[i]!="0" && s1[j]!="0" ) {
System.out.println(s[i]);
resultFileBufWrtr.write(s[i]);
resultFileBufWrtr.append(System.getProperty("line. separator"));
}}
Pls tell me the modification or tell me the way................ pls
Similar Threads
-
Comparing two files and extract the difference
By trkece in forum New To JavaReplies: 4Last Post: 02-16-2011, 06:11 AM -
Comparing two XML files
By anuj_sharma in forum XMLReplies: 1Last Post: 02-07-2011, 09:09 AM -
Comparing Two Text Files
By coder09 in forum New To JavaReplies: 15Last Post: 03-03-2009, 06:11 AM -
[SOLVED] Comparing two files
By Doctor Cactus in forum New To JavaReplies: 7Last Post: 02-27-2009, 10:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks