我需要将 a 转换CSVRecord为 aList以获取元素的位置。
所以我用了这个:
List<CSVRecord> records = csvParser.getRecords();
int i = records.get(0).indexOf(element);
但是,records.get(0)返回 aList<CSVRecord>而不是List<String>...
此外,我不能使用csvParser.getHeaderNames();,因为之后我需要复制带有标题的文件。