posted 23 years ago
Hi !!
From the way i understand u'r question, i think u r reading frm one file but writing into a different file , right!
i am assuming u have some function which evaluates which line is to be removed & returns true / false. if return value is false then write to file
basically the code will be some thing of this sort
FileReader fr=new FileReader("time.txt");
BufferedReader br=new BufferedReader(fr);
boolean b;
while((str=br.readLine())!=null )
{
b = evaluate(str);// evaluate is a function which determies
// whether line has to be removed or not
if (b==false)
{
// code for appending
}
}
there are many other ways of doing the above.
i hope i am clear
cheers,
Preeti Pathak