We did this in one of our projects by providing a bean to the splitter
which returns an iterator. In this iterator, we first read the first line
and store it in this iterator as instance variable. For each next() call,
we read the next line and and "prefix" it with the first line.

Best,
Christian

Sent from a mobile device
Am 29.11.2012 23:28 schrieb "Oliver Geisser" <[email protected]>:

> Hello,
>
> I am using a splitter to handle a big txt file (streaming mode). I need to
> combine the first line
> with all the other lines and store each result into a database.
>
> What is a good Camel solution for this?
>
> Example input file:
>
> Hello
> A
> B
> C
> ...
>
>
> This needs to be combined into:
>
> Hello A
> Hello B
> Hello C
> ...
>
> Every result is stored into a database.
> It's important to use streaming because of the size of the input file.
>
>
> My first idea was to use a Splitter and then store the first line into an
> Exchange property.
> But this does not work because the Splitter creates new Exchanges for every
> line.
>
> So how do I combine the first line with all the other lines?
>
> Thanks
> Oliver
>
> --
> og
>

Reply via email to