How do I add new line to an output file?
I'm doing a calculation in a java program and saving the output using writeBytes(s) where s is a String variable. The result is an output that is one long line (no "new line" or "line break"). Can anyone tell me how to start a new line so that my output files look nicer? Thanks in advance
R.Berg
Re: the response. I don't understand how to use /n
Thanks for the quick response. I recognize /n means new line, but I don't know how to communicate to the computer
with it. Here's what I tried:
ds.writeByte(/n);
ds.writeByte(s,/n);
s = s+ "/n";
s = s +/n;
ds./n;
/n;
all of which failed except the third line, but that just added the characters /n every place I wanted a line return. Thank
you for your patience, but could you explain where I put the /n?
R. Berg
Re: How do I add new line to an output file?
You can concat one +"\n" to the String variable. So that each time the writeBytes(String) method is called one new line will be added.
Best wishes
Samudra
Re: Re: Thanks! That worked!
Thanks to Samudra and all respondees for selflessly helping out!
R. Berg