camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sadiq <>
Subject Parsing issue with unmarshal and bindy.csv with double quotes and commas in a single field
Date Wed, 19 Apr 2017 05:10:16 GMT
I'm experiencing a parsing issue using Bindy to unmarshal a CSV file into a
List of POJOs (my POJO class is annotated with @CsvRecord).

The CSV file contains the following:

123,"1970-84 Windshield Washer Jar, Multi Application",Available
234,"1967-75 6 Cyl/ Small Block 9"" Clutch Bellcrank Assembly",Available
345,"1971-79 Fan Blade 19-1/2"", 7 Blade",Available

It's the fourth line that is causing an issue:
java.lang.IllegalArgumentException: No position 4 defined for the field:
Available, line: 3 must be specified (it says line 3, but I believe that's
because my CsvRecord class has the skipFirstLine=true)

The CSV parsing seems to be handling commas within a field surrounded by
double quotes since the 2nd line is okay. It's also handling escaping double
quotes correctly within fields since the 3rd line is fine too.

But the issue is when commas are present after an escaped double quote
within a field that is surrounded by double quotes -- it seems to want to
separate each comma into a new field when it should just be treating it as a
single field.

I'm using the latest version of Camel 2.18.3 and still observing this issue.

My route is:

	.bindy(BindyType.Csv, ProductDeltaCsvDataModel.class) //throwing exception

This is my CsvRecord POJO class:

@CsvRecord(separator = ",", skipFirstLine = true, quote = "\"", quoting =
public class ProductDeltaCsvDataModel {

	@DataField(pos = 1, required = true)
	private String partNumber;
	@DataField(pos = 2)
	private String longDescription;
	@DataField(pos = 3)
	private String status;

	//setters and getters

I believe this to be a bug unless there is some configuration I need to set?

Can someone confirm that this is a bug and how I go about logging this bug?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message