• Post Reply Bookmark Topic Watch Topic
  • New Topic

New Line Character  RSS feed

 
karthick sambanghi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am writing some data into a text file. This data uses System . getProperty("line.separator") to get a new line.

It is working fine in Eclipse IDE. But when i make it as .exe(Executable file) using exe4j all the data's are writing in a single line.

I have tried using the below to get a new line working

\n
\r\n
System . getProperty("line.separator")

Below is my piece of code




Any helps will be appreciated

Thanks
 
Tim Cooke
Marshal
Posts: 4051
239
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please can you edit your post to UseCodeTags (<-- click) for your code snippet. That will make it much easier to read and will most likely invite more responses to your question. It really isn't easy trying to read it as it is and a lot of folks simply won't bother.
 
Tim Cooke
Marshal
Posts: 4051
239
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, please BeForthrightWhenCrossPostingToOtherSites (<-- click)
I see you have posted the same question on StackOverflow yesterday.
 
Campbell Ritchie
Marshal
Posts: 56587
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using StringBuffer rather than StringBuilder?
What exactly does the replace() call do? How many characters are you replacing? Does that change its behaviour if you turn it into an .exe? Why are you using an .exe rather than an executable jar?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!