directory monitor in a loop

Hello,

I am trying to handle new files content in a long time loop.
I found the component “Directory Monitor” which watches a folder and executes, when a new file arrived. Then I can do something with the new file content.
But how can I continue to wait for the next new file? My recursive loop only works one time.

How to handle nested loops?

Best regards
Sabine

Hi Sabine,

The recursive loop is most likely the wrong choice. Read the node definitions. The loop will only run a second time if the lower input port has some data which will then be passed back to the loop start. I don’t think that is what you want.

You could use the “Generic loop start” with the “Variable condition loop end” and simply never meet the set condition so it will loop forever. Still, is that really what you want?

Personally I would create a workflow that reads all the files in the directory and processes each one of them. You can then run this workflow either on knime server or via batch mode and windows scheduler (or other appropriate scheduling tool for you OS).

1 Like

Hi,

thank you for your answer!
I started with a “Generic Loop Start/Variable Condition Loop End” yesterday, but had problems. Today I added a CSV-Writer node at the end and now it works (don’t really knowing why).
Thanks again,
Sabine

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.