【发布时间】:2019-10-30 10:51:02
【问题描述】:
我需要在 .csv 文件中的特定单元格中写入 org.apache.commons.csv 库,而不会迭代并复制所有行。
我试过了:
Reader reader = Files.newBufferedReader(Paths.get(Properties.dataFilePath));
CSVParser csvParser = new CSVParser(reader, CSVFormat.DEFAULT);
List<CSVRecord> records = csvParser.getRecords();
records.get(rowNumber)[columnIndex] = value;
但这是不允许的。
编辑 1
我的 IDE 提到:The type of the expression must be an array type but it resolved to CSVRecord
【问题讨论】:
-
你能分享一下具体的错误信息吗?
-
我用消息更新了我的问题。
标签: java csv apache-commons-csv