How to remove rows unexpected data found

Hi Team,

I want to remove row if column(BB) string or special character found in the row.

If Column(BB) row found Integer or Double or Decimal found no need to remove the row.

Input:
image

Expected output:
A table with columns labeled "AA" and "BB" contains three rows with "yyy" 25.33, "ooo" 225.21, and "mmm" 78 respectively. (Captioned by AI)

Regards,
Raja G

Hi @Raja.G

DT = DT.AsEnumerable.Where(Function(row) IsNumeric(row("BB").ToString)).CopyToDataTable

Output:

image

Regards,

1 Like

HI,

Can you try the following sample?

arrDr = dt.AsEnumerable.Where(Function(r) Double.TryParse(r("BB").ToString,Nothing)).ToArray()

Sample
Sample20240808-3.zip (9.6 KB)

Regards,

1 Like

Hi @Raja.G

Please utilize the attached Xaml Flow that includes your solution.

dt= dt.AsEnumerable.Where(Function(r) System.Text.RegularExpressions.Regex.IsMatch(r(“BB”).ToString(),“\d+(.\d+)?”)).CopyToDataTable

image

Main.xaml (8.4 KB)

Hi ,
You can try below example

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