Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I use tWaitForFile to start processing files in a directory. But how can I refer the found files? I read that the filename is saved in the global Variable (CREATED_FILE), but how should I use that in the next step (tFileInputXML) ?
Up to now each try results in an error.
Hope you have an idea, because I think that is a normal usage of processing the files found in tWaitFor File.
Kind regards, Detlev
Sorry, title should refer to tWaitForFile. I just want to use the created file for a tMap.
Hi,
Could you please try below method?
The component screenshots are as below.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi Nikhil,
thanks for your answer. After some tries I got a run without errors. I think the "Run if"-Component with the condition can be exchanged by the "OnSubjobOk"-link. The result is the same, but I mustn't use the condition.
Because the files I'm looking for are XML-Files I use the tFileInputXML instead of tFileInputFullRow. Hope that is still ok, because then I got the content in tLogRow as expected.
The problem I looked for a solution is to process all new files created in the directory. So I hope the usage of "continue loop" is the appropriate change. But after changing that parameter the process didn't create any output. Hope you can advice.
Kind regards,
Detlev
This is a slight modification of @nthampi's answer which solve your problem.
You will need a tWaitForFile connect via a Row link to a tFlowToIterate. Then connect your file component via an iterate link. If the Row connecting your tWaitForFile to the tFlowToIterate component is called "row1", then your tFlowToIterate will add your filename to the globalMap with a key of "row1.FILENAME". This can be used to call the file using ((String)globalMap.get("row1.FILENAME")).
Regarding "continue loop" I believe you have the right idea there.