CSV data format record separator not working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CSV data format record separator not working

Pedro Catalão
Greetings!

I'm trying to unmarshal some custom CSV using the CSV data format like this:

>  <unmarshal>
>     <csv delimiter="," recordSeparator="|" headerDisabled="true"/>
> </unmarshal>


So I would expect this:

> roses, red|violets, blue


To be split into 2 records but the apparently the recordSeparator attribute
is not being used anywhere to split the records so I end up with only one
record with 3 elements/columns being them:

> roses
> red|violets
> blue


The recordSeparator I chose, is passed through to CsvDataFormat
(org.apache.camel.dataformat.csv) but then never used within CSVParser
 (org.apache.commons.csv).

Any idea if this is a bug or if I could try something different so it works
as expected?

Camel version is 2.20.1

Many thanks,
Pedro Catalão
Reply | Threaded
Open this post in threaded view
|

Re: CSV data format record separator not working

Claus Ibsen-2
Hi

Sounds like a little bug, also you are welcome to try with latest
version to see if it works there.
And if its still a bug, then try to see if you can fix it and submit a
JIRA ticket and provide the patch as a github PR .. thanks.

On Mon, Feb 11, 2019 at 3:01 PM Pedro Catalão <[hidden email]> wrote:

>
> Greetings!
>
> I'm trying to unmarshal some custom CSV using the CSV data format like this:
>
> >  <unmarshal>
> >     <csv delimiter="," recordSeparator="|" headerDisabled="true"/>
> > </unmarshal>
>
>
> So I would expect this:
>
> > roses, red|violets, blue
>
>
> To be split into 2 records but the apparently the recordSeparator attribute
> is not being used anywhere to split the records so I end up with only one
> record with 3 elements/columns being them:
>
> > roses
> > red|violets
> > blue
>
>
> The recordSeparator I chose, is passed through to CsvDataFormat
> (org.apache.camel.dataformat.csv) but then never used within CSVParser
>  (org.apache.commons.csv).
>
> Any idea if this is a bug or if I could try something different so it works
> as expected?
>
> Camel version is 2.20.1
>
> Many thanks,
> Pedro Catalão



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: CSV data format record separator not working

Pedro Catalão
Thanks Claus, I will try your suggestion.

On Mon, Feb 11, 2019 at 3:29 PM Claus Ibsen <[hidden email]> wrote:

> Hi
>
> Sounds like a little bug, also you are welcome to try with latest
> version to see if it works there.
> And if its still a bug, then try to see if you can fix it and submit a
> JIRA ticket and provide the patch as a github PR .. thanks.
>
> On Mon, Feb 11, 2019 at 3:01 PM Pedro Catalão <[hidden email]>
> wrote:
> >
> > Greetings!
> >
> > I'm trying to unmarshal some custom CSV using the CSV data format like
> this:
> >
> > >  <unmarshal>
> > >     <csv delimiter="," recordSeparator="|" headerDisabled="true"/>
> > > </unmarshal>
> >
> >
> > So I would expect this:
> >
> > > roses, red|violets, blue
> >
> >
> > To be split into 2 records but the apparently the recordSeparator
> attribute
> > is not being used anywhere to split the records so I end up with only one
> > record with 3 elements/columns being them:
> >
> > > roses
> > > red|violets
> > > blue
> >
> >
> > The recordSeparator I chose, is passed through to CsvDataFormat
> > (org.apache.camel.dataformat.csv) but then never used within CSVParser
> >  (org.apache.commons.csv).
> >
> > Any idea if this is a bug or if I could try something different so it
> works
> > as expected?
> >
> > Camel version is 2.20.1
> >
> > Many thanks,
> > Pedro Catalão
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>