Results 1 to 4 of 4
  1. #1
    mew
    mew is offline Member
    Join Date
    Nov 2007
    Posts
    70
    Rep Power
    0

    Default New line character

    I am writing to a file using outputstream. What is the line feed character because I want to add line feed character into the file.

  2. #2
    Abdul Ajis is offline Member
    Join Date
    Dec 2007
    Posts
    12
    Rep Power
    0

    Default

    \n i think

    \n \r try this also

  3. #3
    mew
    mew is offline Member
    Join Date
    Nov 2007
    Posts
    70
    Rep Power
    0

    Default

    Thanks but it does not work. It prints \n in the file.
    Any other ideas?

  4. #4
    dmacvittie is offline Member
    Join Date
    Aug 2007
    Posts
    30
    Rep Power
    0

    Default

    Hey Mew,
    Sounds like your system is using some other line separator...
    Run this code:

    System.Properties prop = System.getProperties();
    prop.print(System.out);

    then look at the output and see what the line.separator element looks like. That is the line separator on your system.

    If you want to do this system independently, then you should call OutputStream.writelin() where ever you need a newline.

    Don.
    , then
    Don MacVittie F5 Networks - DevCentral

Similar Threads

  1. getting each character from keyboard
    By Sreejesh25 in forum Advanced Java
    Replies: 6
    Last Post: 03-05-2010, 08:12 PM
  2. Character Object
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-07-2007, 01:04 PM
  3. Getting character set from a website
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-26-2007, 01:53 PM
  4. reading text character by character
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-09-2007, 09:54 PM
  5. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 01:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •