Announcement Announcement Module
Collapse
No announcement yet.
DelimitedLineTokenizer not escaping delimited characters when writing to a file? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DelimitedLineTokenizer not escaping delimited characters when writing to a file?

    Hello all
    i tried the following test, hoping that the delimiter would be escaped if it was present in one of the fields to be sent to output, but it failed instead
    Code:
    @Test
      public void testTokenizer() {
        String delimiter = ",";
        DelimitedLineAggregator<String> aggregator = new DelimitedLineAggregator<String>();
        aggregator.setDelimiter(delimiter);
        Object[] fields = {"foo", 1 , "test    with tabx, and something else    andatab\tand again", "testwtiheol and again", 2};
        String result = aggregator.doAggregate(fields);
        Assert.assertEquals(fields.length, fieldsStr.length);
    }
    How do i get around that? do i have to write my own BeanWrapperExtractor which escapes the delimiter if present in the field?

    w/kindest regards
    marco
Working...
X