| reader |
        FileStream fileNamed: fileName do: [ :file |
                "skip headers"
                file
                        nextLine;
                        nextLine;
                        nextLine.
                reader := NeoCSVReader on: file.
                reader
                        separator: Character tab;
                        recordClass: MyClass;
                        addField: #name:; "throw away"
                        addField: #name:;
                        addField: #type:; "throw away"
                        addField: #type:; "throw away"
                        addField: #type: converter: [ :str | MyOtherClass on: 
str ];
                        addFloatField: #balance:;
                        addField: #ignore:;
                        addField: #ignore:;
                        addField: #ignore:;
                        addField: #ignore:.
                ^ reader upToEnd.
                 ].

To ignore fields, I'm passing a selector that will be overwritten later on
in the parsing, but that doesn't work with the last fields, so I had to add
a special setter to my domain object to ignore those - yuck!

Is there a feature like this built into NeoCSV?

Thanks :)



-----
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/NeoCSV-skip-fields-tp4685751.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

Reply via email to