There is no built-in tool to skip an unknown number of lines.
If you want to skip only the first line (title bar), you can call withSkipHeaderRecord()when creating the parser.
A more general solution would be next()to call iterator:
Iterable<CSVRecord> parser = CSVFormat.DEFAULT.parse(new FileReader("example.csv"));
Iterator<CSVRecord> iterator = parser.iterator();
for (int i = 0; i < amountToSkip; i++) {
if (iterator.hasNext()) {
iterator.next();
}
}
while (iterator.hasNext()) {
CSVRecord record = iterator.next();
System.out.println(record);
}