Hi Joachim,
I had to deal with similar situations, like having a "merged csv"
file, with non CSV headers in between (old style text headers) and
other fancy stuff, what I did was to wrap the underlying stream with
my own class that filtered the "invalid rows" [*], etc.
AFAIR NeoCSV is "character based", as in it operates on a per
character feed and it knows whether it is inside a quoted text with a
new line in between, or at the end of the line. What I'd do is also to
wrap the underlying stream, with my own logic for toggling whether to
pass the read character or skip it until the real CSV content begins.
This way if you're inside the CSV content of the file, calling #next
will return the read character, but if after that you're in the
"non-CSV" part of the file, then calling #next will keep skipping
until it reaches the beginning of the proper CSV.
This might be tricky since you'd likely need to also modify #skip:
#atEnd and similar methods used by NeoCSV, but you either wrap the
stream to make NeoCSV believe it is dealing with a proper CSV or you
modify NeoCSVReader (which is also an option, and could have this
"wrapping logic" inside of it).
So my answer is not a solution to your problem, but at least you have
some ideas to explore. :-)
Best regards!
Esteban A. Maringolo
> --
> You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
va-smalltalk...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/va-smalltalk/a7e8540e-9145-4054-8fc7-472b5e9a79a6n%40googlegroups.com.