I m using super csv's bean reader to read my csv files. It works fine if the POJO and columns match.
For eg My pojo has theses values.
//They have getters and setters.
//just to make it simple I have used public.
public myPojo
{
public columnA;
public columnB;
}
My super csv code looks like this.
final String[] header = beanReader.getHeader(true);
int amountOfColumns=beanReader.length();
CellProcessor[] processor = new CellProcessor[amountOfColumns];
so if my csv files looked like this it works fine.
columnA,columnB
value1,value2
but if my csv files had an extra column, It fails with this exception check that the corresponding nameMapping element matches the field name in the bean. Can I avoid this exception and just ignore this column. Basically it says it could not find the corresponding setter.
unknownColumn,columnA,columnB
someValue,value1,value2