FasterXML / FasterXML/jackson-dataformats-text

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

Aperta
#167 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
3.x csv pr-needed
Lingua principale
Java
Stelle
455
Fork
164
Merge medio
6g 10h
PR unite (30g)
2

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.