OK, here is my unchecked code.
You have to replace with valid names, strings the oldfile,newfile,oldname,newname texts, and the most important part the "we need this line" condition in the if statement.
STRING* mystring = "";
var eof = 0;
var chars = 0;
fhandle1 = file_open_read(oldfile);
fhandle2 = file_open_write(newfile);
while(!eof) {
chars=file_str_read(fhandle1, mystring);
if(-1 == chars)
eof = 1;
else
if(we need this line)
file_str_write(fhandle2, mystring);
}
file_close(fhandle1);
file_close(fhandle2);
file_delete(oldfile);
file_rename(oldname,newname);
Good luck!