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 摘要。