You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by London12345 <ma...@gmail.com> on 2012/09/26 15:27:44 UTC

extract data from mutlipe csv file convert to xml

Hi,
I am using camelCSV to parse csv to xml and the final xml will have elements
retrieved from multiple csvs.
Can you please let me know whether camel csv provide support to link
different csv's?

thanks



--
View this message in context: http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: extract data from mutlipe csv file convert to xml

Posted by Christian Müller <ch...@gmail.com>.
Ok, feel free to open a JIRA at [1] to improve this.

[1] https://issues.apache.org/jira/browse/CAMEL

Best,
Christian

On Mon, Oct 1, 2012 at 10:58 AM, London12345 <ma...@gmail.com> wrote:

> Thanks Christian .
>
> I trired  using @DataField(pos=1),however if there are 3 elements in the
> row,Camel forcing to define all the fields like
>
> @DataField(pos=1)
> private String a;
> @DataField(pos=2)
> private String b;
> @DataField(pos=3)
> private String c;
>
> If I miss one position then getting error message.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720297.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: extract data from mutlipe csv file convert to xml

Posted by London12345 <ma...@gmail.com>.
Thanks Christian .

I trired  using @DataField(pos=1),however if there are 3 elements in the
row,Camel forcing to define all the fields like 

@DataField(pos=1)
private String a;
@DataField(pos=2)
private String b;
@DataField(pos=3)
private String c;

If I miss one position then getting error message.

Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720297.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: extract data from mutlipe csv file convert to xml

Posted by Christian Müller <ch...@gmail.com>.
@CsvRecord
public Class Foo {

   @DataField(pos = 3)
   private String bar;

...
}

should do the trick...

Best,
Christian

On Fri, Sep 28, 2012 at 11:03 AM, London12345 <ma...@gmail.com> wrote:

> Thanks.I have seen the camel bindy documentation but I am unable to find
> the
> details about how to skip data from single row.I can only see skipping
> entire line.
>
> For example :
> CSV file:Claus,Ibsen,Camel in Action 1,2010,35
>
> I just want to pick third element in the row and rest to be ignored.Can you
> please let me if such option available in bindy?.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720190.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: extract data from mutlipe csv file convert to xml

Posted by London12345 <ma...@gmail.com>.
Thanks.I have seen the camel bindy documentation but I am unable to find the
details about how to skip data from single row.I can only see skipping
entire line.

For example :
CSV file:Claus,Ibsen,Camel in Action 1,2010,35

I just want to pick third element in the row and rest to be ignored.Can you
please let me if such option available in bindy?.





--
View this message in context: http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720190.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: extract data from mutlipe csv file convert to xml

Posted by Christian Müller <ch...@gmail.com>.
Yes, checkout the documentation [1]
or simple try it out...

[1] http://camel.apache.org/bindy.html

Best,
Christian

On Thu, Sep 27, 2012 at 2:56 PM, London12345 <ma...@gmail.com> wrote:

> Thanks .
>
> I have just started using camel bindy and trying to read only selected
> fileds from each row.Is there a way to skip unwanted data from each row
> when
> we annotate fields using @DataField?
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720122.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: extract data from mutlipe csv file convert to xml

Posted by London12345 <ma...@gmail.com>.
Thanks .

I have just started using camel bindy and trying to read only selected
fileds from each row.Is there a way to skip unwanted data from each row when
we annotate fields using @DataField?





--
View this message in context: http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720122.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: extract data from mutlipe csv file convert to xml

Posted by "michal.warecki" <mi...@gmail.com>.
Hi!

Maybe try to use aggregator EIP: http://camel.apache.org/aggregator2.html

Cheers,
Michal



--
View this message in context: http://camel.465427.n5.nabble.com/extract-data-from-mutlipe-csv-file-convert-to-xml-tp5720030p5720044.html
Sent from the Camel - Users mailing list archive at Nabble.com.