Meaningless Drivel is fun!*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 2251
    
  47
I'm not sure exactly what you mean but you have added a space after outputting the weight which is not required.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Adding Spaces and new lines to a text file