I want to write an empty line in a file. I am trying to save a String variable with the value newLine = "\n". And then trying to write it to the file using the method fileOutputStream.write(newLine.getBytes()). But the thing is i only get a black empty square rather than an empty line.
And then when i try to write anything to the file nothing turned up.
printWriter.write(NameRemovalConstants.commentLine1); added nothing to the file.
PrintWriter printWriter = new PrintWriter(new FileOutputStream(outputFile,false))
Even this didn't help.
Joined: Mar 04, 2009
I have modified the code after a little googling and now i have changed the print writer object to
PrintWriter printWriter = new PrintWriter(new FileWriter(outputFile));
But when i am writing to the file i keep getting the empty blank squares.
Only this time not at the end of the line but at the beginning.