https://forum.world.st/NeoCSV-and-special-handling-for-some-columns-tp4852282p4852294.html
Imagine something like this:
neoCSVReader := (NeoCSVReader on: stream).
neoCSVReader
separator: $,;
recordClass: PriceRecord;
addIgnoredField; "<name>"
addField: #securityUniqueId: ; "<ticker>"
addField: #date: converter: [ :string | Date readFrom: string readStream pattern: 'yyyymmdd' ]; "<date>"
addFloatField: #open: ; "<open>"
addFloatField: #high: ; "<high>"
addFloatField: #low: ; "<low>"
addFloatField: #close: ; "<close>"
addIntegerField: #volume: . "<vol>"
neoCSVReader skipHeader.
priceRecords := neoCSVReader upToEnd.
The #recordClass: is optional. If not, you can get an array of arrays instead.
You can add #addIgnoredField for all the ones you want to ignore, then add the #addNumber: etc for the number ones, etc. To write a default empty value, I would use my own converter. Something like:
addField: #stringcolumn: converter: [ :string | string isEmptyOrNil ifTrue: [ '' ] ];
addField: #numbercolumn: converter: [ :string | string isEmptyOrNil ifTrue: [ 0 ] ifFalse: [ NeoNumberParser parse: string ] ];
Hope this helps.
Cheers,