
I have requirement like this, a file contain maximum 1000 lines. I want to cahnage the 501 line content. I know this logic , reading the file content and changeing the 501 line content and crating one more file and storing this changeing information
String line=null;
String fileContent=""
while((line.bufferedReader.readLine())!=null) {
fileContent+="";
// code for to chang the 501 line content.
}
// heare we are creating one more file
BuffredWriter br=new BufferedReader(new FileWriter("newfile.txt")); br.write(fileContent);
i know this logic . I want only one word in 501 line but it take lot of time to read all content of old file and storing in new file.
Please help me ,Is there any better logic to chang content in the file without creating new file?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.