Le 1/7/15 12:35, jtuc...@objektfabrik.de a écrit :
Hi there,
I am on VA Smalltalk
For your next successful project you should jump in Ph.... :)
and therefor using an older version of NeoCSV
(SvenVanCaekenberghe.14). I found a bug in this old version that is
somewhat special.
It seems NeoCSV cannot handle the situation where the very last field
is just empty AND if there is no trailing CRLF at the end of the file.
Somethinng like this:
SecondLastColumnValue;;<EOF>
In that case, readField fails because it tries to do a readQuotedField
or readUnquotedField, both of which try to read beyond EOF.
So I changed readField to this:
readField
^self atEnd "In case the very last field of a file is empty, like
'45;56;;'"
ifTrue: ['']
ifFalse: [self peekQuote ifTrue: [self readQuotedField]
ifFalse: [self readUnquotedField]]
and all seems fine so far.
Side note: My original file has a trailing CrLf but if I upload it via
a browser to a Seaside Server, the Browser cuts off the trailing CrLf
(I can see this in the Browser's Network debugging tools - both in IE
and FF) - so it seems NeoCSV has to be ready for this situation.
Joachim