Split CSV file according to the number of rows

Hello everyone! I have a huge file containing around 8000 rows and I’d like to split this data in multiples CSV file of 100 rows each.

Data structure is pretty simple, I have an ID column (unique value), a comment column and a Counter column to count the lines.

I created an additional column with a math formula node (floor($Counter$ / 100) + 1) that gives the same value every 100 rows. So the first 100 rows will have: 1, the next (from 101 to 200):2 and so on… in this way I know that I can cut the table every time there is a change of value in this column.

then I should loop trough the data and filter according to this column but I’m not able to give instruction to the CSV writer to create multiple files, I’m trying to create a variable but it’s not working. Also in the variable setting of the node there is no field for “file path” or “file name”. the result is that all the data are written always on the same file.

anyone know how can i solve this?

thanks a lot!