How can i divided datatable into multiple tables with 15 rows each and last table should be less than 15 rows or equal to 15 rows?
@MitheshBolla
Try this one in UiPath:
dividedTables = (From row In inputTable.AsEnumerable()
Select row
Let rowNumber = inputTable.Rows.IndexOf(row) + 1
Group By groupIndex = (rowNumber - 1) \ 15 Into Group
Select Group.CopyToDataTable()).ToList()
Anil_G
(Anil Gorthi)
July 9, 2023, 11:22am
3
@MitheshBolla
Check this …instead of 20000 you can use your rows 15
@srinusoft37
Then try this…
Create a loop inside the excel application scope and break the data in chunks of 20000 and use append range
to get data in chunks of 20000 use dt.AsEnumerable.Skip(Cint(20000*counter)).Take(20000)
Create a counter variable and assign it to the index variable in for loop… in the for loop in Argument use Enumerable.Range(0,Cint(Dt.Rowcount/20000)+1).ToArray
use append range with the above given chunks formula
Hope this helps
cheers
Cheers