Hello,
I’m having some difficulties creating a LINQ query to replace certain values in a column. I have a table with more than 200k rows and in the column with index 0, named “Depósito”, there are values ranging from A001 to A999, B001 to B999, and C001 to C999. I want to replace “A” with “8810”, “B” with “8811”, and “C” with “8817”.
There is also a screenshot of my the first lines of my table.
use invoke code activity and pass the below expression
For Each row As DataRow In dt.AsEnumerable
If row(0).ToString.StartsWith(“A”) Then
row(0)=row(0).ToString.Replace(“A”,“8810”)
Else
If row(0).ToString.StartsWith(“B”) Then
row(0)=row(0).ToString.Replace(“B”,“8811”)
Else
If row(0).ToString.StartsWith(“C”) Then
row(0)=row(0).ToString.Replace(“C”,“8817”)
Else
row(0)=row(0).ToString
End If
End If
End If
Next