How to split a single file in multiple file with chunk loop start.

Hello,
i’m tring to find some solutions to this easy problem, but i didn’t find a way out.

I will have huge file with more than 500.000 records. I want to split in multiple file of 80.000 rows.

I used Chunk Loop Start. But i’m having problemi with the definition of file_names based on “CurrentIteration”.

This is the WF:
image

Chunk is setted oon 80.000 rows.

I choose in “Create File/Folder Variables” this options to have the name of the file with the number of the iteration:
image

From the configuration, this is what i’m expecting from this node:

8 iterations, with each file named with the n° of the iteration.

Configuration of “Excel Writer” is this:


Using as a path the variable chosen before.

But in this way i’m able to have only one iteration:

Obviusly i’m wrong, but in which part of the process?
Many thanks to every people who can help me, i tried to find something on YT or in the forum, but i didn’t find anything with this specific settings.

Thanks,
Alberto

Take a look at the datatype of your variable. Current iteration is an integer (“i”)
Create file and folders in your configuration needs arrays of string values. You want to reconfigure your create files folder variables node. There should be some examples on the hub
I just found an old one but there should be newer ones as well

br

2 Likes

Hello @albertoruggeri1,

Create Files/Folder Variables node already creates path variable so don’t think you need to use String to Path (Variable) node. You can try using String Manipulation (Variable) or Variable Expressions node to create flow variable holding file name from currentIteration flow variable and feed that to Create Files/Folder Variables node. Example from @Daniel_Weikert should help. If not I (or someone else as there are many community members willing to help) can build a simple example for you to check :wink:

Br,
Ivan

1 Like