Home Answers Viewqa Java-Magazine changing the file content

 
 


basha
changing the file content
0 Answer(s)      4 months and 11 days ago
Posted in : Java Magazine

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









Related Pages:
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
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 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
changing Background Color
changing Background Color       In this program, we are going to tell you how you can change background color of a pdf file. You can change the background color
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
How to design a changing color of the chameleon, changing color of the chameleon, color of the chameleon
How to design a changing color of the chameleon       Have you seen the chameleon to changing...; Save File: Now go to File menu > Save optimized. Final Result
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
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" %>
iterate through map and write the content in a separate file
iterate through map and write the content in a separate file  I am trying to save the data from file to a map, then iterate through map and write... through the above file and save it in maps depending on if it is a concept
iterate through map and write the content in a separate file
iterate through map and write the content in a separate file  I am trying to save the data from file to a map, then iterate through map and write... through the above file and save it in maps depending on if it is a concept
iterate through map and write the content in a separate file
iterate through map and write the content in a separate file  I am trying to save the data from file to a map, then iterate through map and write... through the above file and save it in maps depending on if it is a concept
Program to read a dynamic file content - Java Beginners
Program to read a dynamic file content  Hi, In a single folder daily date wise the datas will be stored automatically in the .txt format...", "020209.txt", "030209.txt","040209.txt". In a single file I'll get the datas
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
Write a program in Java to append content at the end of an already existing file.
Write a program in Java to append content at the end of an already existing file.  Write a program in Java to append content at the end of an already existing file
Read content for JPEG image File in Java - Java Beginners
Read content for JPEG image File in Java  How to Read content for JPEG image File in Java? or Extract text from JPEG image File in Java
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
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...
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
jQuery Load Content
; In this section you will learn how to load content of a text file using jQuery... of simple text file and then show on the text box. Our jQuery Load Content example... to use jQuery to Load the content from server side text file and show
How to save data to excel with a 2.1 work sheet format without changing it?
How to save data to excel with a 2.1 work sheet format without changing... and save it to excel file then read it again .. the problem is , when data is saved , the extension file is changed to excel file with text ( tab limited
How to write content of one file to another file and calculate checksum for accuracy.
on the output stream.  In this Example, we will write the content of a file to another file. And calculate the value of checksum at writing time with the help of CheckedOutputStream class. After it we will read the content of new file
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.    
FILE
the content of the file. import java.io.*; public class Appliance { public...;Java Read content of File import java.io.*; public class Appliance { public...FILE  There is a file named Name.txt that contains information
How to copy many files into one file and how to manage the content of the final file?
How to copy many files into one file and how to manage the content of the final file?  Hi, i'm trying to code that copy the content of all txt file... is it possible to put the content of each file below the other one ? Here is my
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
display resume content in webpage - JSP-Servlet
display resume content in webpage  Hi everbody, I have to display resume(.pdf, .doc,.rtf..txt)file content into a webpage(jsp or html). please i want help like are there any APIs available or any solution?? thank in advance
how to print the content of file in 2d matrix having same dimension as given in file(n*m).
how to print the content of file in 2d matrix having same dimension as given in file(n*m).   here is code: import java.io.File; import... IOException { Scanner s = new Scanner(new File("rfg.txt")); List list = new
How to transfer the excel content on consol to the database
How to transfer the excel content on consol to the database   Hi I have write the java code with which I am able to read the excel file and display its contents on the console but I am unable to transfer the content
Changing column name
Changing column name      ... for changing the column name in the preparedStatement(). This will return...;}   } } web.xml file for this program
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
Locate a Node and Change Its Content
Locate a Node and Change Its Content       This Example shows you how to Change the Content...;Node and Change Its Content  * 
Changing root Password
Changing root Password  how do i change the root password in mysql
problem in viewing the mail's content using javamail
problem in viewing the mail's content using javamail  i'm using...); File file=new File("mails/"+user+"/"+Fetchmail.replacename(name)+".eml...; try{ files=file.getPath(); File
changing an image based on checking checkbox using HTML & JavaScript, Please put div blocks
changing an image based on checking checkbox using HTML & JavaScript, Please...="checkbox-content-small"> <div align="left" class="jive-checkbox"> <div align="left" class="jive-rendered-content-checkbox">
Add a jsp file to java application
a file,having any application,code or any content..</h2><br/> <...;%@include file="success.jsp" %> content of success.jsp is copied into the current... content and also permit updates to the included content without changing
After changing url params d req checkboxes are not showing as clicked in jsf programming - Java Server Faces Questions
After changing url params d req checkboxes are not showing as clicked in jsf programming  Hi, Here i have Library.java file (collected from Jboss richfaces) There is having a list of artist . If u click on a particular
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
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
Change a file timestamp
C:\vinod\Math_package>javac ChangeFileDate.java C:\vinod\Math_package>java ChangeFileDate Change file timestamp example! Enter file name with extension: StrStartWith.shtml Enter last
Showing content of a file using JSP & jQuery
Showing content of a file using JSP & jQuery In this tutorial , we will discuss how to display text ,saved in a text file using JSP & jQuery. In this example, the content of the text file is fetched and display on the browser
Copy one file into another
Copy one file into another In this section, you will learn how to copy content of one file into another file. We will perform this operation by using...;This string is copied from one file to another\n"); bf.close(); InputStream
MySQL Creating account and changing password
MySQL Creating account and changing password       This MySQL provide the new creating account... the password file to run make the /var/yp /directory after you make
How to copy a file in java
a content of one file to another file. In java, File API will not provide any direct way to copy a  file.  What we can do is, read a content of one... a content of one file to another file. import java.io.FileInputStream; import
Viewing contents of a JAR File
Viewing contents of a JAR File       This section shows you how you can read the content of jar file... of the given jar file without extracting. It also shows the jar file content, a default

Ask Questions?

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.