Search code examples
knime

Knime loop to write csv file in different folder?


I am running a knime chunk loop to write always the same procedure in different csv files: enter image description here

The Part with the python script until the csv write is working, when I do it without loop, but somehow he is not writing in the customized folder path, if I have the loop inside.

The target is to write a new csv-file for every loop (the output is a list).

The nodes are: Chunk Loop: Rows per chunk: 51 Create file name:

  1. Options Selected directioy: C:/....
  2. Flow Variables: FileName: currentIteration

CSV Writer: Flow Variables: filename: CurrentIteration

How can I change the folder path of the file? He is always saving it in the default folder


Solution

  • Here is an example workflow (apologies for the weird blurry Windows 10 screenshots):

    KNIME workflow image

    Create File Name config:

    create file name config

    CSV Writer config:

    CSV Writer config

    You may need to run each node individually in order to create the flow variable before you can select it in the following node.