Filter DataTable End with Numbers

Hi,

I want to filter a datatable that ends with numeric value like abc123, gbg123
i am trying with regex expression but not able to get the desire result
Data table
ID NAME
001 xyz
ab4321 abc
123abc lmn
abc PQR

In the above i want id having digits in end 001,ab4321

below is my expression
dtResult.AsEnumerable.Where(function(x) x(“ID”).ToString.Equals(System.Text.RegularExpressions.Regex.Match(x(“ID”).ToString, “[0-9]+$”))).CopyToDataTable

give a try on following:

(From d in dtData.AsEnumerable
Where System.Text.RegularExpressions.Regex.IsMatch(d("ID").ToString.Trim, "\d+$")
Select r = d).CopyToDataTable

Also have a look here:

[FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

1 Like

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