File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes  Writing in a text File is appending some SPECIAL Symbol on using any StringBuffer with \n Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark " Writing in a text File is appending some SPECIAL Symbol on using any StringBuffer with \n" Watch " Writing in a text File is appending some SPECIAL Symbol on using any StringBuffer with \n" New topic
Author

Writing in a text File is appending some SPECIAL Symbol on using any StringBuffer with \n

buntha Choudhary
Ranch Hand

Joined: Jul 03, 2009
Posts: 136



I am using this piece of code to write some Strings in a Text File , but on using the newLine() , it is adding some INVALID Charatcters
nation[#]patry[#^]like

It is not appending the text to the next line , and in the same line replacing the next line with some unknown charaters.
I am appending the values in stringBuffer with a next line("\n") after each string.

THIS SCENARIO IS COIMING IN FEW SYSTEMS. IN SOME SYSTEM IT IS WORKING FINE BUT IN SOME IT IS RASING


Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 7796

The end of line character is platform-specific. '\n' (0x0A) is the end-of-line character for Unix systems. Windows systems use "\r\n" (0x0D 0x0A). Java methods like BufferedWriter.newLine() and System.getProperty("line.separator") are provided to utilize or obtain the current system's end-of-line character.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
 
subject: Writing in a text File is appending some SPECIAL Symbol on using any StringBuffer with \n
 
MyEclipse, The Clear Choice