Jon Fields created CAMEL-9432:
---------------------------------
Summary: Bindy CSV separator not treated as regex but fixed
character in all cases
Key: CAMEL-9432
URL: https://issues.apache.org/jira/browse/CAMEL-9432
Project: Camel
Issue Type: Bug
Components: camel-bindy
Affects Versions: 2.16.1
Reporter: Jon Fields
Priority: Minor
In the camel-bindy documentation (http://camel.apache.org/bindy.html) it says
that the {{@CsvRecord separator}} parameter is interpreted as a regex. While
that does seem to be the case when the record is being parsed, it seems to be
treated as a literal string when autospanLine is true.
For example, if we have
{code}
@CsvRecord(separator="\\s+", autospanLine=true)
{code}
and we have defined three string {{@DataField}} fields, and we have a line of
input like this:
{code}
field1 field2 field3a field3b
{code}
then the third field value will be
{code}
"field3a\s+field3b"
{code}
Looking at the code in {{BindyCsvDataFormat.java}} it seems that this is
because in some cases the separator string is treated as a literal string, not
a regex. For example, this also seems to be true in some cases in the
{{unquoteTokens}} method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)