Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-26-2009, 06:15 PM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default Need help formatting File Output
I am using java.io.FileWriter to save the program data....
It doesn't see the'\n'....just writes in big long lines. I should know the answer to this, but could anyone refresh me on how to get carraige returns in my output using FileWriter or another class?


I found the answer in my book PrintWriter....is the class sorry

Last edited by aaroncarpet; 11-26-2009 at 06:25 PM. Reason: feeling real stupid
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-26-2009, 06:24 PM
Senior Member
 
Join Date: Sep 2008
Location: Voorschoten, the Netherlands
Posts: 1,259
Rep Power: 3
JosAH is on a distinguished road
Default
Originally Posted by aaroncarpet View Post
I am using java.io.FileWriter to save the program data....
It doesn't see the'\n'....just writes in big long lines. I should know the answer to this, but could anyone refresh me on how to get carraige returns in my output using FileWriter or another class?
Wrap your FileWriter in a PrintWriter and you can use more convenient methods such as print() and println().

kind regards,

Jos
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-26-2009, 06:26 PM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default
Yeah I am changing all my filewriters to printwriters duh I feel really retarded for not knowing that
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Tags
file output, filewriter

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writting output to file! hakan123 New To Java 8 11-19-2009 05:39 PM
Need help formatting output and some code A5i19 New To Java 6 11-09-2009 05:58 AM
No output to file shiva Java Servlet 0 04-24-2009 03:06 PM
Search a word(taken from one file) in another file and give the line as the output SwapnaNaidu New To Java 7 11-19-2008 03:09 PM
Writing to excel file erasing existing formatting jmHoekst New To Java 1 09-16-2008 06:58 PM


All times are GMT +2. The time now is 08:32 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org