IO
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Senthil_Kumar
Posted On:   Wednesday, December 29, 2004 05:44 AM

How can I format the text when writing into the text files

Re: IO

Posted By:   Anonymous  
Posted On:   Wednesday, December 29, 2004 09:34 PM

I would suggest using the PrintWriter to write a text file. That way you can be assured of all the formatting that you need in the file. You can instantiate the PrintWriter like this:




PrintWriter myWriter = new PrintWriter(new FileWriter(fileName), true);
myWriter.println("This will be first line.");
myWriter.println(" This is second line with a tab....etc");
myWriter.close();



Thanks!
About | Sitemap | Contact