ColumnPositionMappingStrategy mappingStrategy = new ColumnPositionMappingStrategy();
mappingStrategy.setType(MyBean.class);
String[] columns = new String[]{"name", "value", "amount1", "currency", "comments"}; // the fields to bind to in your JavaBean
mappingStrategy.setColumnMapping(columns);
CsvToBean csv = new CsvToBean();
CSVReader reader = new CSVReader(new FileReader(filePath), CSVParser.DEFAULT_SEPARATOR, CSVParser.DEFAULT_QUOTE_CHARACTER, CSVParser.DEFAULT_ESCAPE_CHARACTER, 0, false, false);
List<MyBean> list = csv.parse(mappingStrategy, reader);
if (list.size() != 3) {
System.out.println("Error - list size is wrong.");
}
MyBean myBean = list.get(2);