FasterXML / FasterXML/jackson-dataformats-text

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

Open
#167 9 comments 0 reactions 0 assignees View on GitHub
3.x csv pr-needed
Dominant language
Java
Stars
455
Forks
164
Avg merge
6d 10h
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.