Can anyone tell whats the best way of reading a CSV file. The file I am trying to read is nearly 23 MB so it's a taking a lot of time to read the lines through buffered reader:
BufferedReader CSVFile = new BufferedReader(new FileReader("HostSystems.csv"));
String dataRow = CSVFile.readLine();
while (dataRow != null){
String[] dataArray = dataRow.split(",");
for (String item:dataArray) {
System.out.print(item + "\t");
}
System.out.println(); // Print the data line.
dataRow = CSVFile.readLine();
}
Is there another efficient way?