Need help of file comparision.

Please provide me the code how to compare two file . Suppose there are 3 file.We compare file1 with file2 line by line(Row wise). Suppose i compare logonid(unique) of file1 with file2. If logonid is match then copy the entire row to file3. Please tell me the what is the code for it.

[311 byte] By [minatia] at [2007-11-27 11:47:31]
# 1

How about you post the code you have tried so far in a compilable format which demonstrates the problems you are experiencing and then we will take a look and help if we can.

No one here is going to write this for you.

c0demonk3ya at 2007-7-29 18:13:47 > top of Java-index,Java Essentials,Java Programming...
# 2

> Please provide me the code how to compare two file .

> Suppose there are 3 file.We compare file1 with file2

> line by line(Row wise). Suppose i compare

> logonid(unique) of file1 with file2. If logonid is

> match then copy the entire row to file3. Please

> tell me the what is the code for

> it.

stop posting the same message over and over again, maggot

OnBringera at 2007-7-29 18:13:47 > top of Java-index,Java Essentials,Java Programming...
# 3

start with some basic algorithm

open file streams

while ( eof of file1 && eof of file2) {

stringvariable1 = read a line from file1 (figure out how to do it)

stringvariable2 = read a line from file2 (--do--)

boolean = compare stringvariable1,stringvariable 2 ( how?)

if (boolean) //true

then write stringvariable1(or 2) to file3

else

print "no matching lines found"

}

close filestreams

:-)

Rk

passion_for_javaa at 2007-7-29 18:13:47 > top of Java-index,Java Essentials,Java Programming...