CSV Read

public static void main(String[] args) throws Exception {

File csvFile = new File("file/hello.csv/hello.csv");

try (Reader in = new FileReader(csvFile)) {

CSVParser parser = CSVParser.parse(in, CSVFormat.EXCEL.withFirstRecordAsHeader());

String[] headers = parser.getHeaderMap().keySet().toArray(new String[0]);

Iterable<CSVRecord> records = parser.getRecords();

System.err.println(Arrays.toString(headers));

for (CSVRecord record : records) {

System.err.println(record);

System.err.println(record.size());

}

}

}