When using CsvListReader to read unknown columns of String item, it is expected to trim off tailed SPACE from non-quoted item for our purpose. Neither to prepare unknown number of Trim cell processors nor trim each item from returned list of String works (how can I know whether it is quoted?).
By modifying the original org.supercsv.io.Tokenizer, I create a new TrimTokenizer. It maybe helpful to other people. Please check the attachment.
By the way, it will be much more memory efficient if apply String#intern() before accept result text. In my client application it is critical to reduce memory consumed by many redundant String value.
I'll take a closer look at this later, but have you tried enabling the
surroundingSpacesNeedQuotes
preference? See the website for more details.surroundingSpacesNeedQuotes works for my problem.
My proposed TrimTokenizer will not remove leading SPACE, which would be a critical limitation.
Thank you very much.
Last edit: Feng Dihai 2013-04-25
Ticket moved from /p/supercsv/bugs/40/
Problem was solved by using surroundingSpacesNeedQuotes preference