Results 1 to 2 of 2

Thread: Writing CSV-files with quoted fields

  1. #1
    Join Date
    Jul 2005
    Location
    Helsingborg, Sweden
    Posts
    504

    Default Writing CSV-files with quoted fields

    The DelimitedLineTokenizer can parse lines with quoted strings. The DelimitedLineAggregator, however, simply concatenates the FieldSet items without any quoting or looking for delimiter characters in the string.

    Where's the best place to add this behavior? In a custom FieldSetCreator or a subclass to DelimitedLineAggregator? It's the aggregator that knows what the delimiter is, so maybe a subclass is the answer. But the delimiter is not protected and has no getter...
    Ulrik Sandberg
    Jayway (www.jayway.com)
    Spring LDAP project member

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    I would recommend to use the FormatterLineAggregator, but it looks like you are using Batch 1.x. In that case it's your choice, but I suspect that you get more control in the FieldSetCreator (which doesn't exist in 2.0 because this kind of use case is slightly awkward).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •