Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java - unix file to windows file

835140Jan 28 2011 — edited Feb 1 2011
I have a java program which saves a file to disk in linux which is then attached and emailed. The file is saved and opened in windows, so I want the file to be saved as a windows file.

I have tried replacing the LineFeeds(LF) with CRLF with the command dataBuf.replaceAll("\n","\r\n"), but this does not work. dataBuf is simply a string and is saved to file.

what can I do to the string in order to save it properly as a windows file?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2011
Added on Jan 28 2011
18 comments
4,479 views