I have the below csv file which is comma delimited , now from this file i already have read the value of the column der_id ,but please advise now the output that i am getting on console that is the column der_id and its value I want to be stored it in a separate excel sheet in the first column itself. please advise how can I achieve this through apache poi
wert,der_tran,der_id,der_version,cvns_num,cvs_type
AB42126325,0,694698683,0,651626843,13002
AB42126326,0,694698686,0,651626846,13001
presently I am reading this in this format..
public class Parsingcsv {
public static void main(String[] args)
{
Parsingcsv obj = new Parsingcsv();
obj.run();
}
public void run()
{
String csvFile = "C:\\abc_2.csv";
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
try
{
br = new BufferedReader(new FileReader(csvFile));
while ((line = br.readLine()) != null) {
// use comma as separator
String[] id = line.split(cvsSplitBy);
System.out.println("[der_id= " + id[2] + "]");
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
System.out.println("#####################3");
}
}
and its output is in this format on console i am getting..
der_id
694698683
694698686