camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CAMEL-10853) CsvDataFormat should be completed with 'CSVFormat.withTrim'
Date Fri, 17 Feb 2017 16:04:41 GMT


ASF GitHub Bot commented on CAMEL-10853:

GitHub user ribeaud opened a pull request:

    [CAMEL-10853] Support 'ignoreHeaderCase', 'trim' and 'trailingDelimiter'

    The next time, I will need your formatter. I spent quite some time fixing **Checkstyle**
    And I still did not fix the EOL issue. But anyway, you're probably to review, reformat
the code anyway. Cheers, christian.

You can merge this pull request into a Git repository by running:

    $ git pull feature/CAMEL-10853

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1473
commit 9947591d1b6e1373b6248d1493ceebed2ef92dff
Author: Christian Ribeaud <>
Date:   2017-02-17T15:58:21Z

    [CAMEL-10853] Support properties 'ignoreHeaderCase', 'trim' and


> CsvDataFormat should be completed with 'CSVFormat.withTrim'
> -----------------------------------------------------------
>                 Key: CAMEL-10853
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-csv
>    Affects Versions: 2.18.1
>            Reporter: Christian Ribeaud
>            Priority: Minor
> In *Camel* {{org.apache.commons.csv.CSVFormat}} is indirectly configured via {{org.apache.camel.model.dataformat.CsvDataFormat}}.
Although it is possible to tell {{CSVFormat}} to trim leading and trailing blanks via {{CSVFormat.withTrim}},
this property can NOT be set in {{CsvDataFormat}}.
> h4. Workaround
> As a workaround, one could do the following:
> {code:java}
> CsvDataFormat dataFormat = new CsvDataFormat("\t") {
>             @Override
>             protected void configureDataFormat(DataFormat dataFormat, CamelContext camelContext)
>                 // This is how we force the engine to trim the values
>                 org.apache.camel.dataformat.csv.CsvDataFormat csvDataFormat = (org.apache.camel.dataformat.csv.CsvDataFormat)
>                 CSVFormat format = csvDataFormat.getFormat();
>                 csvDataFormat.setFormat(format.withTrim());
>                 super.configureDataFormat(csvDataFormat, camelContext);
>             }
>         };
> {code}
> h4. Question
> Are they other properties which should be considered?

This message was sent by Atlassian JIRA

View raw message