Write multiple CSV file to a loop

Hi all,

My goal is to write multiple csv files via a loop, with the titles of the rows as the filenames of the csv. So title of csv file 1 = B, csv 2 = B etc. (inspired by Write multiple files. )

I’ve tried to adjust multiple solutions from this forum but couldn’t get it to work as desired. Does anyone has experience with this and can show me what i need to adjust? Attached is my attempt, where i only get 1 file and not the desired 8 with the correct names.

csv_loop_test.knwf.knwf (17.8 KB)

Thanks so much in advance! Any help would be highly appreciated :slight_smile:

Best regards,
Vincent

@VJAM the creation of Flow Variables for Paths is maybe not 100% straightforward. Maybe this example might help to sort it out. The “path_values” is maybe not perfectly named. I think this is constructed that you could pass several Folder variables as collection strings.

Also: CHunk Loop Start might have to be set to 1. Often I prefer the Table Row to Variable Loop Start node.

image

2 Likes

Dear @mlauber71,

Thanks so much for your fast response and tips! Sorry for asking, are you able to share your edited workflow? I’ve tried the settings from your screenshot but still only got 1 csv file in this case.

Thanks again!

Best regards,
Vincent

1 Like

@VJAM you can download the edited workflow from the KNIME hub.

I changed the Chunk Loop to 1 to get one entry per line.

2 Likes

Dear @mlauber71,

Thanks again so much for your detailed explanation and help!! Couldn’t have done it without you!

Best regards,
Vincent

2 Likes

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