Hi Matheen,
Can you explain your problem a little more?  Are all the files going to be
available at the same time?  Do you know how many files you need to
aggregate?

For example, in pseudo code:

    <route>
        <from uri="file://TEST?fileName=order.csv&noop=true"/>
        
       do all your bindy processing here but send to aggregator rather than
'file'
       set your correlation header 
      
       
      <to uri="direct:aggregateXML"/>
   </route>

   <route>
        <from uri="direct:aggregateXML"/>
        <aggregate groupExchanges="true" eagerCheckCompletion="true">
                                <correlationExpression>
                                        <camel:header>someheader</camel:header>
                                </correlationExpression>
                                <completionTimeout>
                                        <camel:simple>10</camel:simple>
                                </completionTimeout>
                                <completionSize>
                                        
<header>someCompletionSizeHeader</header>
                                </completionSize>            
            write some bean to wrap all your exchange response bodies in the
enclosing XML tag 
            <to uri="bean:combineExchangeResponses"/>
           <to uri="file://TESTOUT?fileName=orderLine.xml"/>
        </aggregate>


    </route>

You can correlate your CSV files you are processing by setting a common
header among them to the same value.  You can either complete processing by
size or by a timeout.  Once you aggregate, you will have a grouped exchange. 
You can have some a simple bean to iterate through your exchanges and then
wrap them in the enclosing XML before writing ot the file system.

This is all pseudo code and would have to be improved.

Thanks,
Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/way-to-convert-multiple-csv-files-to-single-xml-file-tp5717048p5717099.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to