parsing in csv lines

Hi,

I'm almost new in Java programing. I have written a prog. which reads a csv. data and do works with the information.Before, my csv. data had just one line(happy days) but now it has more lines.

Now I need to go to a certain line (5th) and take a certain object (00002).

csv:

Report Date,"Jul 23 "

Generated By,"Ghazale Malek"

Test Suite,"LINDA ",

Test Session,"Name","ID","Test Set","Comment","Assigned To","Planned Start","Actual Start","Planned End","Actual End"

,"Automatische Tests - tglich","00002","Regression/Automatische_Tests","","","","","",""

I just don't know how to go to this line (the rest is like before I hope)

import java.io.*;

import java.util.*;

publicclass CSVReader{

publicstaticvoid main(String[] args){

//

try{

File CSVReader=new File("c:/input.csv");

// CSV datei wird gelesen

FileReader reader =new FileReader(CSVReader);

BufferedReader br =new BufferedReader (reader);

String line ;

try{

while ((line =br.readLine())!=null)

{

System.out.println(line);

//StringTokenizer st = new StringTokenizer(line,",");

//System.out.println(st);

int iFirstComma = line.indexOf(",");

int iSecondComma = line.indexOf(",", iFirstComma+1);

String sTestFileId = line.substring(iFirstComma+1, iSecondComma);

String cmd ="qftest -batch ";

cmd +=" \"P:\\o2\\86 Testautomatisierung\\qftest\\linda\\LindaTestSuite\\qf-test\\" + sTestFileId + ".qft\"";

System.out.println(cmd);

try{

Process p = Runtime.getRuntime().exec( cmd );

}catch (IOException e){

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

catch (IOException e){

// TODO Auto-generated catch block

e.printStackTrace();

}

}catch (FileNotFoundException e){

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

Can anybody give me a clue?

Thanks

[3570 byte] By [ghma] at [2007-11-27 11:24:32]
# 1

There's a simple read-only csv JDBC driver on sourceforge:

http://csvjdbc.sourceforge.net/

-Puce

Pucea at 2007-7-29 15:58:52 > top of Java-index,Java Essentials,Java Programming...