On Tue, Jan 13, 2009 at 1:42 AM, Sam Hu <[email protected]> wrote: > Hello everyone! > > Just found I can not append a new line to a file when writing data to a File > or FileConduit instance. > > File file=new File("myfile.txt"); > myfile.append("This is line 1"); > myfile.append("This is line 2"); > About code just generate "This is line 1This is line 2" > I tried below code but all the same: > myfile.append("\n\nThis is line 1\n\n"); > myfile.append("\n"); > myfile.append("This is line 2");
If you're on Windows, the line ending convention is "\r\n", not just "\n", so you could try that. Alternatively, use a Print/FormatOutput (depends on whether you're using 0.99.7 or HEAD).
