I am working with csv file having very large dataset. while reading file i had extracted 3rd place(BALANCE) ';' separated numeric value from each rows with in while loop iteration.i want to store those values(BALANCE) into listOF string.how can i do this.
import java.io.File;
import java.io.FileNotFoundException;
import java.io.*;
public static void main(String[] args)throws IOException {
String filename = "bank-full.csv";
File file = new File(filename);
try {
Scanner inputStream = new Scanner(file);
inputStream.next();
int count=0;
while (inputStream.hasNext())
{
String data = inputStream.next();
String[] values = data.split(";");
double BALANCE = Double.parseDouble(values[2]);
System.out.println(BALANCE);
inputStream.close();
}
catch (FileNotFoundException ex) {
Logger.getLogger(Demo.class.getName()).log(Level.SEVERE, null, ex);
}
}
}