Filter excel data by keyword

Hi @indrajit.shah,

Yeah it was just to give you an idea, there’s slight change in method, so as you have to search Keyword in every Description and find out whether it’s there or not, .Contains should be there.

Use following code in assign to get description containing keywords.

MatchedDescription (DataTable)= dt2.AsEnumerable().Where(Function(row)  dt1.AsEnumerable().
Select(Function(r) Convert.ToString(r.Field(Of String)("Keyword"))).Any(Function(x) (Convert.ToString(row.Field(Of String)("Description"))).Contains(x))).
CopyToDataTable()

AND

Use following code in assign to get description not containing keywords.

UnMatchedDescription (DataTable)= dt2.AsEnumerable().Where(Function(row) Not dt1.AsEnumerable().
Select(Function(r) Convert.ToString(r.Field(Of String)("Keyword"))).Any(Function(x) (Convert.ToString(row.Field(Of String)("Description"))).Contains(x))).
CopyToDataTable()

Note -
here, dt1 (datatable) having Keyword column &
dt2 (datatable) having Description column.

Here, I’m attaching sample workflow —> containsMatched.xaml (10.2 KB) (If you need )