Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

How to force Windows newLine

Thread view: 
fealfu@gmail.com - 17 Apr 2006 11:06 GMT
Hi,

I've a problem with new line character. I am in Windows platform but
when I write a file with a BufferedWitter with println I obtain the
character "\n" x0D like separator (Unix Separator). My System property
line.separator is "\r\n".

Can someone tell me how can I obtain files with the correct \r\n
Windows new line character?.

Thanks in advance.
Brzezi - 17 Apr 2006 12:43 GMT
pon, 17 kwi 2006 o 12:06 GMT, fealfu@gmail.com napisał(a):

> I've a problem with new line character. I am in Windows platform but
> when I write a file with a BufferedWitter with println I obtain the
> character "\n"

Say a bit more about how you are doing that, or it`ll be better if you
could paste some sourcecode...

Pozdrawiam
    Brzezi
Signature

[    E-mail: brzezi@enter.net.pl ][                                           ]
[       Ekg: #3781111            ][                                           ]
[ LinuxUser: #249916             ][                                           ]

fealfu@gmail.com - 17 Apr 2006 13:12 GMT
Resolved

The problem was another process that automatically was replacing "\r\n"
form "\n" and I don´t know it.

All works fine.

Thanks a lot.
Roedy Green - 17 Apr 2006 20:45 GMT
>I've a problem with new line character. I am in Windows platform but
>when I write a file with a BufferedWitter with println I obtain the
>character "\n" x0D like separator (Unix Separator). My System property
>line.separator is "\r\n".

Only println knows the line separator convention.  Everything else
just prints what you tell it literally. For sample code see
http://mindprod.com/applets/fileio.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.