changing the file content
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?
View Answers
Ads
Related Tutorials/Questions & Answers:
changing the file content
changing the
file content I have requirement like this, a
file... , reading the
file content and changeing the 501 line
content and crating one... in 501 line but it take lot of time to read all
content of old
file and storing
Changing Executable Jar File Icon
Changing Executable Jar
File Icon I have created an executable jar
file for my java program and the icon that appears is the java icon. I will like...;Hi,
You may use JSmooth to create executable java
file and also associate icon
Advertisements
Changing loacation for file object - JSP-Servlet
Changing loacation for
file object Hai,
For uploading a
file i used the FileOutputStream() method. And uploading works perfectly. This method allows parameter as
file name or the full path(that is from the drive
how to modify content of XML file
to xml
file to replace "XYZ".Every time with the
content of text box the
file should...how to modify
content of XML file hi,
I want to modify
content of a xml file.There are two tags of similar name
say
<ContentName>C:\Myinfo
Java File content type
Java
File content type
In this section, you will learn how to get the
content type of the specified
file.
Description of code:
This is essential part of the
file. In various applications, there is a use
of
content type. Here we
Storing content from file path to an array
Storing
content from
file path to an array Hi,
I have a path... would like to access the "Animation.txt"
file from this path and store the contents in this text
file to an array. I am using jsp.
I can access my path but how
changing of data...
servlet.database is not
changing in 10 second hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have... this servlet.database is not
changing in 10 second...what should i do..?? reply fast
changing of data...
data
changing in 10 second hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have given 10 second.but... is not
changing in 10 second...what should i do..?? reply fast
changing of data...
changing of data... hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have given 10 second.but once... is not
changing in 10 second...what should i do..?? reply fast
how to display the excel file content in the jsp
how to display the excel
file content in the jsp How to present the
content of the newly created excel
file in the following jsp to the web browser:
print("code sample");
<%@ page import="java.io.InputStream" %>
Java display file content in hexadecimal format
Java display
file content in hexadecimal format
In this section, you will learn how to read the
file content and display it
in hexadecimal format.
Reading a
file is a common task but here we are going to display the
file
data
How to write content of one file to another file.
;
In this example we will open a
file and then write the
content in new
file... is : 1836825431
Content of one
file successfully written in other
file... of the data
being written in the second
file.
About CheckedOutputStream class
Changing MySQL Port Number
Changing MySQL Port Number How to change the MySQL port no in windows.
Hi,
Open the my.ini
file present in the MySQL server... to the desired port number.
After making change in my.ini
file save the
file
Changing pictures - Java Beginners
Changing pictures I found some html code that allows pictures to be changed on a web page. I copied the code and saved it as an html
file. when I... Explorer that have pictures
changing on them and they do not get blocked? 
changing uiview background color
changing uiview background color
changing UIView background color in ios
self.view.backgroundColor = [UIColor colorWithRed:244.0f/255.0f green:230.0f/255.0f blue:183.0f/255.0f alpha:1.0f
How to read content of JPEG file in Java?
Example of reading the
content of JPEG
file in Java
Java JAI API helps... in the Java Program. In this article we will see how to
read the JPEG image
file.
We will use the javax.imageio.ImageIO class for reading the image
file data
Show content of .vm file as output using Velocity
Show
content of .vm
file as output using Velocity
 ...
content of .vm
file using velocity and also shows how
to use Iterator......" in
StringOutput.vm
file, that message will be show as output.
 
changing selection color of <button>
changing selection color of dear all,
i have loaded image in border less button tag when button is selected with tab key i get brown color rectangle around image. how do i change color of that rectangle from brown to white
How to read and compare content of two different text file
Description:
In the given example you will see how a two text
file's content... of comparison
is in such a way that it takes
content of a
file and assign it to as a string
andthen compare it with the other
file's content which too assigned