How to filter the excel row with dynamic key words?

Hi @Dorothy_lee ,

Follow below steps.

  1. image
    Read KeyWord Excel into one datatable(KeyWordDT) and convert it to Array of Keywords as below
    KeyWordArr=KeyWordDT.AsEnumerable().Select(Function (a) a.Field(of string)("Column Name").ToString).ToArray

  2. Read target excel into Datatable (InputDT).

  3. Assign ResDT=InputDT.Clone

  4. Use below expression in assign activity.

ResDt=(From row in InputDT.Asenumerable
Where KeyWordArr.AsEnumerable.Where(Function(x) row("ColName").ToString.Trim.Contains(x.trim)).Count>0
Select row).CopyToDatatable()
1 Like