Results 1 to 4 of 4
  1. #1
    rsn64 is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Question java program for reading delimited txt file to excel sheet

    Hi,

    I need help for a specific requirement.

    I have some .txt files these contain delimited data, delimiter is the pipe (||) operator.

    Sample data

    Upadate
    Color||blue
    size||6
    size||7
    size||8
    type||cleats
    EOR

    Every record set start with update which tells the beginning of record set and ends with EOR (End of record). The data is between these two. The property name first then pipe operator and then data.

    I am looking for a help to read this txt file by java program and put this to excel sheet. THere I can make modifications to data manually and then want to read it to txt file back.

    Require help on this.

    Thanks

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,891
    Rep Power
    25

    Default

    What part(s) of your program are you having trouble with?
    If you are reading a simple text file, you could use the Scanner class.
    To separate the records at the "||" separator boundary, you could use the String indexOf method to find the || and the use substring.

  3. #3
    rsn64 is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default RE:

    I have no clue about the approach I should take for this IO operation.

    Can you please suggest me a little detailed approach in getting started with the implementation.

    Really appreciate your discussion below.

    Thanks

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,891
    Rep Power
    25

    Default

    Do a Search on this forum for uses of the Scanner class. There are several that read files.

Similar Threads

  1. writing to a excel file from java program
    By priyankabhar in forum New To Java
    Replies: 15
    Last Post: 01-17-2014, 01:39 PM
  2. how to insert a file object in excel sheet using java
    By jyoti.dce in forum Advanced Java
    Replies: 1
    Last Post: 08-11-2010, 07:08 PM
  3. how to read excel file through java program
    By madhuragowda in forum New To Java
    Replies: 2
    Last Post: 04-16-2010, 09:53 AM
  4. How To Add More Rows To Excel Sheet In Java
    By JMartins in forum New To Java
    Replies: 0
    Last Post: 12-31-2009, 12:30 AM
  5. Replies: 5
    Last Post: 08-21-2009, 12:03 PM

Posting Permissions

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