Dt.select using like

I want to select text which is having both the words text DD and Rejected.
I am having text

  1. 0SEP DD CDTR REJECTED?20
  2. 00SEP DD CDTR CORE 20
    3)SE Rejected Ba
    How to select this using dt.select(“text Like pattern”).
    help me with this pattern.

dtFiltered = DT.Select( “text like ‘%DD%’ AND text like ‘%Rejected%’”)

1 Like

Hi @Jesi

Try below codes

It will return datarow[] -> datarow array.
Filteredrow= DT.Select("text like '%DD%' AND text like '%Rejected%'")
Below code will return as datatable.
Filtereddatatable = DT.Select("text like '%DD%' AND text like '%Rejected%'").CopyToDataTable()

Regards,
Arivu

5 Likes

can you please share a sample workflow?

Hi @Akhil,

you can directly use assign activity to filter the data.

Regards,
Arivu :slight_smile:

Do i need to import any library or packages?
I’m getting error like - cannot find column [text]

HI @Akhil,
“text” is column name of the data table.

and “DD” is value of the column

In your data table doesn’t have text column, that’s why thrown exception.

Main (6).xaml (9.0 KB)

Regards,
Arivu

2 Likes

@arivu96 Thanks for the solution :+1::+1:

can we select particular row if column is empty using dt.select(“column Like pattern ”)
help me with this pattern

Hi @Jesi
Yes you can,
DtFilteredRow=dt.select("column =''")

Regards,
Arivu :slight_smile:

1 Like

image