BindyCsvDataFormat broken for pipe delimited files
---------------------------------------------------
Key: CAMEL-3489
URL: https://issues.apache.org/jira/browse/CAMEL-3489
Project: Camel
Issue Type: Bug
Components: camel-bindy
Affects Versions: 2.5.0
Reporter: Steven Lewis
Priority: Critical
Attempting to unmarshall a pipe delimited CSV file into a POJO using Bindy
causese the first and last character the the line processed to be dropped. It
appears that the BindyCsvDataFormat class removes the first and the last
character from the line read from the CSV if the seperator is > 1 characters in
length (see below or line 162-165 in BindyCsvDataFormat). For pipe delimited
files, you need to specify \\| as the seperator, as | is not evaluated
correctly as a java regex by the split fuction. This leads to the first and
last character for the line being parsed being dropped. From the comments it
appears a "fix" was added to remove the first and last character of the line
when the seperator contains quotes or double quotes. Making this determination
using the length of the seperator, rather than evaluating using a regex seems
to be a poor solution that breaks other CSV delimiters.
See Attached for an code example.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.