Results 1 to 2 of 2
  1. #1
    sanjayksaini is offline Member
    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Default Reading from csv file.plz help!!!!!!!!!!

    Hi All
    i am facing problem getting values from csv file.i want to read csv file line by line using an Array.Here is the code:

    File file = new File("TestCaseDataRepository.csv");
    BufferedReader bufRdr = new BufferedReader(new FileReader(file));
    String line = null;
    while((line = bufRdr.readLine()) != null)
    {
    String str[]=line.split(",");
    for(int i=0;i<str.length;i++)
    {
    System.out.println(str[i]);

    }
    }

    Now i want to read the fields in a particular line by using split()
    Now the problem is if the particular field has values which is comma separated then it would also be separated as a different field.
    what should i do??

    Thanks in advance..:):)

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. help in reading file.
    By wanw84 in forum New To Java
    Replies: 2
    Last Post: 10-21-2008, 04:17 PM
  2. reading csv file help
    By fritz1474 in forum New To Java
    Replies: 5
    Last Post: 09-04-2008, 09:41 PM
  3. Right use of file reading ?
    By jurka in forum New To Java
    Replies: 3
    Last Post: 08-27-2008, 09:16 PM
  4. Reading a file for use
    By peachyco in forum New To Java
    Replies: 2
    Last Post: 11-27-2007, 04:49 AM
  5. Reading from a file
    By leebee in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 01:02 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
  •