#1 2012-05-15 23:25:12

drewconnelly
New member
Registered: 2012-03-23
Posts: 3

[resolved] Breaking up a file by lines using cSplitter

Tags: [development, java]

Hello,

I have a Route which loads a file with a cFile component.  At this point I would like to process a seperate message for each line in the file.  I have been trying to do this using the cSplitter component but so far I still just get one message with the entire file contents.  It seems like I must be missing something obvious, can anyone help me?

Thanks!
Drew

Offline

#2 2012-05-16 03:33:03

eost
Talend Team
Registered: 2010-12-07
Posts: 246

Re: [resolved] Breaking up a file by lines using cSplitter

There is an example of using splitter with a text file here http://www.talendforge.org/forum/viewtopic.php?id=23667 .  A bit complex for your case but you can download the example and it should answer your question.

Offline

#3 2012-05-16 15:42:27

drewconnelly
New member
Registered: 2012-03-23
Posts: 3

Re: [resolved] Breaking up a file by lines using cSplitter

Thanks Edward, the example code helped get me started.  I needed to use body(String.class).tokenize("\n") as the Expression for my cSplitter component.

Offline

Board footer

Powered by FluxBB