wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Adding Spaces and new lines to a text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Adding Spaces and new lines to a text file" Watch "Adding Spaces and new lines to a text file" New topic
Author

Adding Spaces and new lines to a text file

Raven Ramirez
Greenhorn

Joined: Sep 25, 2013
Posts: 14
Can't find a way to make a new line and space user inputs on each entry


WHen the user inputs something I get this:
Clifford788.7Scooby1245.1

But I need it like this:
Clifford 7 88.7
Scooby 12 45.1

Please help
Raven Ramirez
Greenhorn

Joined: Sep 25, 2013
Posts: 14
I solved it!! But now there's an extra space that was skipped at the top of the line in the text file like this:
"This line right here" <-------------
Tom 5 22.4
Henry 7 33.7

can someone help with that?

The only difference I changed:
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2176
    
  47
I'm not sure exactly what you mean but you have added a space after outputting the weight which is not required.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding Spaces and new lines to a text file
 
Similar Threads
How to read from a text file and placing three different values in an array?
Displaying things...need help badly!! Please!
Entering many records..Need help!
Write and Read Records
NullPointerException trying to output an array into txt file