FasterXML / FasterXML/jackson-dataformats-text

Use `CsvSchema.ColumnType.NUMBER` and such to coerce field values from plain `String`s

未关闭
#167 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
3.x csv pr-needed
主要语言
Java
星标
455
派生
164
平均合并
6 天 10 小时
30 天内合并 PR
2

描述

Current: https://github.com/FasterXML/jackson-dataformats-text/tree/master/csv

```
File csvFile = new File(fileName);
CsvMapper mapper = new CsvMapper();
CsvSchema schema =...
MappingIterator> it = mapper.readerFor(Map.class)
.with(schema)
.readValues(csvFile);
while (it.hasNext()) {
Map rowAsMap = it.next();
// access by column name, as defined in the header row...
}
```

Desired:

```
MappingIterator> it = mapper.readerFor(Map.class)
.with(schema)
.readValues(csvFile);
```

e.g., if the 1st column specified in `schema` is CsvSchema.ColumnType.NUMBER(can it be integer and floating), then the 1st column in the map should be number instead of string.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。