I have a data table with column name Column1 which could have value which starts with 0 or not. If starts with 0 I need to remove it.
It’s working with for each activity but it’s slow. Any better option.
Thanks
I have a data table with column name Column1 which could have value which starts with 0 or not. If starts with 0 I need to remove it.
It’s working with for each activity but it’s slow. Any better option.
Thanks
LINQ will be faster than For Each DataTable Row activity. Try this code in Invoke Code activity.
Try
'Create a local copy of the DataTable
Dim localDt As DataTable = io_DataWithZeros.Copy()
localDt.AsEnumerable().ToList().ForEach(Sub(row) row("Column1") = row("Column1").ToString.TrimStart("0"c))
'Assign the modified DataTable back to the original ByRef parameter
io_DataWithZeros= localDt
Catch ex As Exception
Console.WriteLine(ex.Message)
End try
@anneebeek Attaching sample workflow
Workflow-Sample.xaml (10.1 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.