You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Guillermo <gl...@tecsisa.com> on 2013/05/08 09:43:07 UTC

Re: Best strategy for skipping lines in CSV files with bindy

Hi,

Finally I have created a processor with a BufferedReader to filter the lines
of the file according to a regular expression, so I get the file as String
only with the important lines. Later, I use bindy as usual.

Regards.

Guillermo.



--
View this message in context: http://camel.465427.n5.nabble.com/Best-strategy-for-skipping-lines-in-CSV-files-with-bindy-tp5731784p5732149.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: AW: Best strategy for skipping lines in CSV files with bindy

Posted by Guillermo <gl...@tecsisa.com>.
Thanks for the reply!

I will think about which of the two forms is the best for me.

Regards.



--
View this message in context: http://camel.465427.n5.nabble.com/Best-strategy-for-skipping-lines-in-CSV-files-with-bindy-tp5731784p5732190.html
Sent from the Camel - Users mailing list archive at Nabble.com.

AW: Best strategy for skipping lines in CSV files with bindy

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
> Finally I have created a processor with a BufferedReader to filter the
> lines of the file according to a regular expression, so I get the file
> as String only with the important lines. Later, I use bindy as usual.

Instead of reading the file by myself using a BufferedReader I would check
the line content inside the route, something like

from("file:data.csv")
    // http://camel.apache.org/splitter.html
    .split().tokenize("\n")
    .choice()
        // http://camel.apache.org/simple.html
        .when(simple("$body regex ..."))
            // http://camel.apache.org/bindy.html
            .marshal().bindy(BindyType.Csv, "my.pack.age.with.data.model")
            .to("direct:process")
        .otherwise()
            .to("direct:ignore")


Jan