Menu

#33 Proposal for a TrimTokenizer which can trim tailed SPACE from non-quoted item.

Outstanding
closed
None
1
2015-01-23
2013-04-25
Feng Dihai
No

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.

1 Attachments

Discussion

  • James Bassett

    James Bassett - 2013-04-25

    I'll take a closer look at this later, but have you tried enabling the surroundingSpacesNeedQuotes preference? See the website for more details.

     
    • Feng Dihai

      Feng Dihai - 2013-04-25

      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
  • James Bassett

    James Bassett - 2013-04-25

    Ticket moved from /p/supercsv/bugs/40/

     
  • James Bassett

    James Bassett - 2015-01-23

    Problem was solved by using surroundingSpacesNeedQuotes preference

     
  • James Bassett

    James Bassett - 2015-01-23
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.