Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.16.1
-
None
-
Novice
Description
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
@CsvRecord(separator="\\s+", autospanLine=true)
and we have defined three string @DataField fields, and we have a line of input like this:
field1 field2 field3a field3b
then the third field value will be
"field3a\s+field3b"
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.