You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "arepaka@hotmail.com" <ar...@hotmail.com> on 2012/06/21 01:28:14 UTC

Does Camel Bindy supports text files

Does camel Bindy supports text file (text file) processing. I am looking the
documentation and I see the annotations only for CSV file and fixed length
files.

In my case, I need to process flat files (.txt) which have pipe separated
data.


--
View this message in context: http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Does Camel Bindy supports text files

Posted by Christian Müller <ch...@gmail.com>.
Yeah, it's well documented at [1].

[1] http://camel.apache.org/bindy.html

Best,
Christian

On Thu, Jun 21, 2012 at 8:23 AM, Charles Moulliard <cm...@gmail.com>wrote:

> For sure that camel-bindy supports also a text file where the separator is
> a pipe.
> Here is an example
>
> *case 3 : separator = '|'*
>
> Compare to the previous case, the separator here is '|' instead of ';' :
>
> 10| J| Pauline| M| XD12345678| Fortis Dynamic 15/15| 2500| USD| 08-01-2009
>
> @CsvRecord( separator ="\\|"  )
> public  Class  Order {
> ...
> }
>
>
>
> Regards,
>
> Charles
> Apache Committer
>
>
>
>
>
> On 21/06/12 01:28, arepaka@hotmail.com wrote:
>
>> Does camel Bindy supports text file (text file) processing. I am looking
>> the
>> documentation and I see the annotations only for CSV file and fixed length
>> files.
>>
>> In my case, I need to process flat files (.txt) which have pipe separated
>> data.
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.**
>> com/Does-Camel-Bindy-supports-**text-files-tp5714792.html<http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792.html>
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>

Re: Does Camel Bindy supports text files

Posted by Henryk Konsek <he...@gmail.com>.
>> I need to process a text file (.txt). So @CsvRecord works for both .txt and
>> .csv files ?

Whenever you talk about processing CSV file and don't mention Stream
[1] component, a unicorn dies. :)

CsvDataFormat csv = new CsvDataFormat();
csv.setDelimiter("|");
// Record represented as List<String> goes to the 'seda:recordQueue'
from("stream:file?fileName=/tmp/mycsv.txt").unmarshal(csv).to("seda:recordQueue");

Unfortunately Stream component works only for streams of lines. As far
as I know it cannot be used to consume stream which records are
separated with some other token.

Best regards.

[1] http://camel.apache.org/stream.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: Does Camel Bindy supports text files

Posted by Charles Moulliard <cm...@gmail.com>.
@CsvRecord works for both .txt and .csv files ? YES YES YES

On Thu, Jun 21, 2012 at 6:53 PM, arepaka@hotmail.com <ar...@hotmail.com>wrote:

> Thanks Charles. In the sample code below, it says @CsvRecord, but in my
> case
> I need to process a text file (.txt). So @CsvRecord works for both .txt and
> .csv files ?
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792p5714867.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Does Camel Bindy supports text files

Posted by "arepaka@hotmail.com" <ar...@hotmail.com>.
Thanks Charles. In the sample code below, it says @CsvRecord, but in my case
I need to process a text file (.txt). So @CsvRecord works for both .txt and
.csv files ?

--
View this message in context: http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792p5714867.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Does Camel Bindy supports text files

Posted by "arepaka@hotmail.com" <ar...@hotmail.com>.
Yes, even I did some research on beanIO and thought it is a good option for
flat file processing.
It is good to know that comes with camel. 


--
View this message in context: http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792p5714869.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Does Camel Bindy supports text files

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

Besides Bindy there is other Camel components for flat files parsing.
http://camel.apache.org/data-format.html

One of the projects I think seems to be very compelling is the new
beanio coming in the new Camel 2.10 release (out later this month)
http://camel.apache.org/beanio.html



On Thu, Jun 21, 2012 at 8:23 AM, Charles Moulliard <cm...@gmail.com> wrote:
> For sure that camel-bindy supports also a text file where the separator is a
> pipe.
> Here is an example
>
> *case 3 : separator = '|'*
>
> Compare to the previous case, the separator here is '|' instead of ';' :
>
> 10| J| Pauline| M| XD12345678| Fortis Dynamic 15/15| 2500| USD| 08-01-2009
>
> @CsvRecord( separator ="\\|"  )
> public  Class  Order {
> ...
> }
>
>
>
> Regards,
>
> Charles
> Apache Committer
>
>
>
>
>
> On 21/06/12 01:28, arepaka@hotmail.com wrote:
>>
>> Does camel Bindy supports text file (text file) processing. I am looking
>> the
>> documentation and I see the annotations only for CSV file and fixed length
>> files.
>>
>> In my case, I need to process flat files (.txt) which have pipe separated
>> data.
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Does Camel Bindy supports text files

Posted by Charles Moulliard <cm...@gmail.com>.
For sure that camel-bindy supports also a text file where the separator 
is a pipe.
Here is an example

*case 3 : separator = '|'*

Compare to the previous case, the separator here is '|' instead of ';' :

10| J| Pauline| M| XD12345678| Fortis Dynamic 15/15| 2500| USD| 08-01-2009

@CsvRecord( separator ="\\|"  )
public  Class  Order {
...
}



Regards,

Charles
Apache Committer




On 21/06/12 01:28, arepaka@hotmail.com wrote:
> Does camel Bindy supports text file (text file) processing. I am looking the
> documentation and I see the annotations only for CSV file and fixed length
> files.
>
> In my case, I need to process flat files (.txt) which have pipe separated
> data.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Does-Camel-Bindy-supports-text-files-tp5714792.html
> Sent from the Camel - Users mailing list archive at Nabble.com.