How to remove rows from datatable whoes index is greater than 5 and save it into same data table

Uipath code

@Pooja_Patil1

Welcome to forums

Index you mean the For Each row or you have the column of the Index?

Thanks

YourDatatableVar = YourDataTableVar.AsEnumerable.take(5).CopyToDaTable

For each row

No it’s not correct solution

Hi @Pooja_Patil1 ,

Would you be so kind as to explain what exactly you mean by Index?
If you simple wanted to retain the first 5 rows, then @ppr’s solution is accurate.
In case that is not what you were looking for, please provide additional info so that we may be in a better position to assist you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.