Remove the Rows contains Only Integer value

Hi,

I Have a table
image
and i want to remove the rows contains only digits. Pls help

1 Like

Try below code

Dim myregex As Regex = New Regex("[0-9]")

datasetB.Select().
    Where(Function(r) myregex.IsMatch(r.Item("ColumnName").ToString())).
    ToArray()

Regards,
Arivu

HI @ShekharRPA

Try this expression

YourDatatableName.AsEnumerable().Where(function(r) Not System.Text.RegularExpressions.Regex.IsMatch(r.Field(Of String)("Column Name"), "[0-9]")).CopyToDataTable

Regards
Gokul

If No column name is there.?
Also I want only remove the digits rows and any special characters with digit.

HI @ShekharRPA

Here is the workflow and excel file

Numeric.xlsx (9.0 KB)
RemoveNumeric.xaml (7.4 KB)

Expression
Dt.AsEnumerable().Where(Function(x) not System.Text.RegularExpressions.Regex.IsMatch(x("Numeric").ToString.Trim,"^[0-9.]")).CopyToDataTable

Regards
Gokul

3 Likes

Hi @ShekharRPA ,

Could you try this and see if it works out for you?

(From row In Dt.AsEnumerable()
Where Not row(0).ToString.IsNumeric()
Select row).CopyToDataTable()

Kind Regards,
Ashwin A.K

1 Like

Thanks @Gokul001 :star_struck:

1 Like

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