Re: How to put Enter key character (!_NEWLINE_!) in text file (Urgent)
Monday, September 10, 2001 03:21 AM
you have to solutions for your question, either you use a primitive
FileOutputStream, and the to each line you add at the end the "
" character like in the following :
FileOutputStream fos = new
FileOutputStream("your file name ");
you do this for each line.
or just to wrap your FileOutputStream in a writer like PrintWriter since you are storing only text, or a PrintStream.
the 2 last classes have the println method which do the job for you
and you don't have to worry about "
" character :
PrintWriter pw = new PrintWriter(new FileOutputStream("your file"));
hope it helps