Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IO Formate  RSS feed

 
JAY MaCaNaWallChucK
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all can some one plz help me with my file out put Formate.. How do i remove spaces from a var and how do i get my in put to print on the next line of the txt file.. insted if righ after each other all on the same line ...... Ne help would be awesome....thkz
 
Mahesh Mamani
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
To remove spaces from the var, u can use trim() function.
For the new-line char, depends, if u use
1. BufferedWriter - u'll have to insert new-line character(\n) after each var.
2. PrintWriter - u can use the println() function.
Hope It Helps

Mahesh
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See here for a show of how to use PrintWriter.
Also, there is a search utility at the top of every forum page that will allow you to search for posts related to a given topic. There have been several related to your question, you may find other ways by searching!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!