954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem in writing the content to a file line by line

Could any one you help me in resolving this issue.

I want to write the content to a file line by line.

I have done the following in my java class.

I have to append the some content into an xml file.
For this I am reading an xml file using FileReader and storing it into a StringBuffer variable. I am appending my content into that StringBuffer variable as well.

Now I have to write the whole content into again an xml file exactly same as it was earlier.

I have tried using \n but it appends some binary content into the xml file.

Thanks in advance.

tummalavishwana
Newbie Poster
1 post since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

You have a problem with the view. Which editor are you using to view the content of XML file. Due to character-set (charset), you have to open an XML file with unicode editor.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You