SuperCSV skips first line while reading CSV file

549 Views Asked by At

I'm Using SuperCSV api to read CSV files and and validates their entries. For a reason, it seems that every read it skips the first row. i do not have Headers on my csvs, and i do need the first row.

I have tried using : CsvMapReader and CsvListReader, but every execute its starts printing only from Line No 2.

Any help would be appreciated. Thanks

I have tried using : CsvMapReader and CsvListReader, but every execute its starts printing only from Line No 2.

Here is a snippet of a code which i use to read the files.

listReader = new CsvListReader(new FileReader(CSV_FILENAME), CsvPreference.STANDARD_PREFERENCE);
listReader.getHeader(true); 
final CellProcessor[] processors = getProcessors();
List<Object> customerList;
while( (customerList = listReader.read(processors)) != null ) {
                        System.out.println(String.format("lineNo=%s, rowNo=%s, customerList=%s", listReader.getLineNumber(),                listReader.getRowNumber(), customerList));
}
0

There are 0 best solutions below