"For Each Row" activity : How to fix the number of row for each loop

Hi

If I have data in excel file 20 rows that I want to proceed in “For each row” activity but I would like to proceed only 5 rows in each loop. How can I specify row number for each loop in this activity?

Regards,
Sathika

@sathikaotk
In general it can be done with take and skip

https://www.tutorialsteacher.com/linq/linq-partitioning-operators-skip-skipwhile
https://www.tutorialsteacher.com/linq/linq-partitioning-operators-take-takewhile

taking the first 5 rows:
yourDatatableVar.AsEnumerable.Take(5)
appending .toList, getting a List of Rows, .CopyToDataTable, getting a DataTable

taking row 5 to 10
yourDatatableVar.AsEnumerable.Skip(5).Take(5)

2 Likes