
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cfile read mode in talend route
hi i have a problem and i need help please, first we start with the screenshoots and after i will explain my problem.
so my job is for exctracting from a file lines containing link to another files, to do that i used csplitter and cprocessor, and after getting lines of that file. i want to read or move those files with the second cfile but the problem with the second cfile istead of read the files it writes in those files the body of the first cfile.
second question i want to know if it's possible to pass to the parameter path of cfile a var like "${in.header.path}"
thanks a lot
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In which case you will need to identify what you want to do in a cProcessor and set a header for each message (each message after the splitter) to identify what you want to do (read or move). The you will have to use a cRecipientList to pass the message to the required messaging endpoint to read or move the file.
This will be a lot harder to implement than using a cTalendJob, but it is possible.
This might be of use: http://people.apache.org/~dkulp/camel/file2.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to do this in a different way. The cFile components are behaving in exactly the way they are supposed to. Your consumer cFile (the one at the beginning) is reading as you would expect. The producer cFile (the ones at the end) is writing content. If you want to read and move (or read or move) files by the data received from a file, you might want to try using a cTalendJob component and writing a Talend job to do this. This will be far easier.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In which case you will need to identify what you want to do in a cProcessor and set a header for each message (each message after the splitter) to identify what you want to do (read or move). The you will have to use a cRecipientList to pass the message to the required messaging endpoint to read or move the file.
This will be a lot harder to implement than using a cTalendJob, but it is possible.
This might be of use: http://people.apache.org/~dkulp/camel/file2.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
just last question to specify move type in the endpoind i should add a parameter in advanced settings of the Cfile with name "move" and value "true" or what
thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not sure move will be as easy as that. I think you *may* have to read the contents of the file to a new file (in your new location) and then subsequently delete the source file.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that's i did last week and it works fine, also another solution is that we can move files using java code.
thanks a lot rhall and have a nice day.
