but it does not work very well. Which character should i use?
Ah, the famous "that didn't work" statement.
That code does something. You expect(ed) it to do something. What either thing is is not clear.
As a hint, though, the class you are using most likely derives from the Print class, this has both print() and println() methods. The println() methods do know how to place a carriage return AND line feed in the file.
Your call is adding one, but not the other, which, to some applications, makes a difference.