You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jaishankar <ja...@wipro.com> on 2014/07/01 13:55:40 UTC

How to Add Double quote at the beginning of the column using Camel Bindy

I'm creating csv file using Camel Bindy. 
In bindy model I have used @CsvRecord( separator = "\",\""
,generateHeaderColumns=true), if I use this the output file is
EMPLOYEE ID","SURNAME","FIRST NAME","SECOND NAME
but I need output as
"EMPLOYEE ID","SURNAME","FIRST NAME","SECOND NAME"

The problem is start and at the end of the column double quote is missing.
Please help me out in resolving this problem.




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: How to Add Double quote at the beginning of the column using Camel Bindy

Posted by Jaishankar <ja...@wipro.com>.
Hi Ravi Godbole,

I got the solution, anyway.. I did the same in setters methods.

I would follow your method coz I feel its better to go in your way rather
than add double quote in setter methods.

Thank you 
Jaishankar



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141p5753506.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: How to Add Double quote at the beginning of the column using Camel Bindy

Posted by Ra...@cognizant.com.
Hi

Have you tried following option ?

@CsvRecord ( separator = ",",generateHeaderColumns=true,quoting=true)

By deafult, " is the quote value. This will take care of all the values with quotes with ',' as seperator.

If you also want same behavior with column headers, you have to do something like this in the POJO annotations.

        @DataField(pos = 3 , columnName = "\"Employee Id\"")
        String id;



-Ravi

________________________________________
From: Jaishankar [jayashankar.c43@wipro.com]
Sent: Tuesday, July 01, 2014 5:25 PM
To: users@camel.apache.org
Subject: How to Add Double quote at the beginning of the column using Camel Bindy

I'm creating csv file using Camel Bindy.
In bindy model I have used @CsvRecord( separator = "\",\""
,generateHeaderColumns=true), if I use this the output file is
EMPLOYEE ID","SURNAME","FIRST NAME","SECOND NAME
but I need output as
"EMPLOYEE ID","SURNAME","FIRST NAME","SECOND NAME"

The problem is start and at the end of the column double quote is missing.
Please help me out in resolving this problem.




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.

Re: How to Add Double quote at the beginning of the column using Camel Bindy

Posted by Jaishankar <ja...@wipro.com>.
I'm using camel version 2.10.0. I've not tried with newer version. 
Is there any solution for this problem with version 2.10.0.




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141p5753185.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to Add Double quote at the beginning of the column using Camel Bindy

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you can write an unit test in camel-bindy source code that
reproduces the issue then that would be great. And you can then log a
JIRA ticket and attach the unit tests.

You are also welcome to try to dive into the camel-bindy source code
to see if you can find and fix the bug.
http://camel.apache.org/contributing.html



On Wed, Jul 2, 2014 at 6:57 AM, Jaishankar <ja...@wipro.com> wrote:
> Now I tried with latest version also but its not working.
> Help regarding this issue please.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141p5753186.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: How to Add Double quote at the beginning of the column using Camel Bindy

Posted by Jaishankar <ja...@wipro.com>.
Now I tried with latest version also but its not working. 
Help regarding this issue please.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141p5753186.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to Add Double quote at the beginning of the column using Camel Bindy

Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel do you use? And have you tried a newer release.

On Tue, Jul 1, 2014 at 1:55 PM, Jaishankar <ja...@wipro.com> wrote:
> I'm creating csv file using Camel Bindy.
> In bindy model I have used @CsvRecord( separator = "\",\""
> ,generateHeaderColumns=true), if I use this the output file is
> EMPLOYEE ID","SURNAME","FIRST NAME","SECOND NAME
> but I need output as
> "EMPLOYEE ID","SURNAME","FIRST NAME","SECOND NAME"
>
> The problem is start and at the end of the column double quote is missing.
> Please help me out in resolving this problem.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-Add-Double-quote-at-the-beginning-of-the-column-using-Camel-Bindy-tp5753141.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/