是否可以根据索引范围将单行解析为多个 bean
示例:
行:“field1”、“field2”、“field3”、....、“field9”
class ColumnsOneAndTwo {
protected String field1;
protected String field2;
}
class ColumnThreeAndNine {
protected String field3;
protected String field9;
}
class Row {
@Parsed(indexes = 0, 1)
protected ColumnOneAndTwo fields;
@Parsed(indexes = 2, 8)
protected ColumnThreeAndNine moreFields;
}
BeanListProcessor<Row> rowProcessor = new BeanListProcessor<Row>(Row.class);
CsvRoutines routines = new CsvRoutines(parserSettings);
for (Row data : routines.iterate(Row.class, <file>, "UTF-8")) {
}