The Artima Developer Community
Sponsored Link

Java Answers Forum
Adding Strings in a Text File

1 reply on 1 page. Most recent reply: Aug 3, 2003 11:53 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
praveen

Posts: 3
Nickname: veen
Registered: Jul, 2003

Adding Strings in a Text File Posted: Aug 1, 2003 10:07 PM
Reply to this message Reply
Advertisement
hai all,
i want the java code for adding " some text & _" for a text file.


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Adding Strings in a Text File Posted: Aug 3, 2003 11:53 AM
Reply to this message Reply
try{
   String fileName = "myTextFile.txt";
   FileWriter fw = new FileWriter(fileName, true);
   fw.write(" some text & _");
   fw.close();
}catch(FileNotFoundException fnfe){
   System.err.println("FileNotFoundException: " + fnfe.getMessage());
}catch(IOException  ioe){
   System.err.println("IOException: " + ioe.getMessage());
 
}

Flat View: This topic has 1 reply on 1 page
Topic: MENU help Previous Topic   Next Topic Topic: Dynamic class loading

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use