Hi,

You can parse the header by your own bean before marshal and then specify 
'skipFirstLine' on csv dataformat.
http://camel.apache.org/csv.html

Thanks,
Tomo


On 02/24/2017 03:00 PM, Juno wrote:
Is it possible to set the delimiter of the header and the delimiter of the
csv file contents differently when storing it in the message queue with csv?

For example, I want to set the delimiter of the header to '|' and the
delimiter of the body to ','.

Header1 | Header2 | Header3 | Header 4 | Header5
Row1-1, row1-2, row1-3, row1-4, row1-5
Row2-1, row2-2, row2-3, row2-4, row2-5
Row3-1, row3-2, row3-3, row3-4, row3-5
.
.
.


The camel route configuration is shown below.

<route id="route_DB2CSV">
        <from uri="timer:case_002?period=30s" />
        <to
uri="mybatis:com.test.SampleMapper.selectList?statementType=SelectList&amp;consumer.useIterator=false"
/>
        <marshal>
                <csv delimiter="|">
                        <header>CHARGE_ID</header>
                        <header>AUTHPOLICY_SEQ</header>
                        <header>UPMU_CD</header>
                        <header>CHARGE_NM</header>
                        <header>HTEL</header>
                        <header>EMAIL</header>
                </csv>
        </marshal>
        <marshal ref="testCrypto" />
        <to uri="activemq:queue:OUT_BOUND_DB2CSV" />
</route>


With this setting, both the header and delimiter of the body are '|' .

Thank you for your kind comments.
Thank you.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Is-it-possible-to-set-the-delimiter-of-header-and-body-of-csv-file-differently-tp5794375.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to