Extract range in datatable

Hi there !

I have a datatable with approximately 700,000 rows and I need to create 33 CSV files each containing 5000 rows. Here’s what I’ve already done:


image
My current algorithm does not delete the first 5000 rows in each loop. Is there a way to extract the first 5000 rows of dataFilter once it is retrieved in Data5000?

Tank’s in advance !

Or else you can use for each row and initialize a count with 0 and write each 5000 rows into a common datatable and write it to excel and reset the count to 0 once 5000 is achieved.

Yes, it’s a possibility, but it’s much longer at runtime. my program now receives 700,000 rows, but it can also receive more than 7 million… I’m looking for the most optimized method.

But i will try it too !