Results 1 to 3 of 3
  1. #1
    javaplus is offline Member
    Join Date
    Nov 2007
    Posts
    97
    Rep Power
    0

    Default line feed in CSV

    I am generating CSV files from my Java project. I don't know how to generate a line feeb in CSV. I tried the following:

    \n
    0x0D0A
    Character.LINE_SEPARATOR

    I am using PrintWriter to write the contents.

    Please advice.

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    It is okay to use \n or your other method for the line feed. It is recognized by Excel and similar CSV applications. But if you are viewing the generated CSV File using notepad like application, you might not see the line feed working because notepad/windows takes \r\n as the line feed.
    You can use either of them.
    dont worry newbie, we got you covered.

  3. #3
    javaplus is offline Member
    Join Date
    Nov 2007
    Posts
    97
    Rep Power
    0

    Default

    Thanks roots. I used Enter key code (13) for the line feed and it worked.

Similar Threads

  1. print line
    By kazitula in forum Java Applets
    Replies: 2
    Last Post: 01-26-2008, 03:05 PM
  2. New line character
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-14-2007, 07:24 PM
  3. New Line in FlowLayout
    By chris12295 in forum New To Java
    Replies: 1
    Last Post: 12-07-2007, 06:49 PM
  4. 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
  5. Help with Drawing a line
    By Rgfirefly24 in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 09:40 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
  •