Filter by use file config?

I have File config as below.

I want data from use debatable for set filter.

I want filter column Code_A , If column Code_A match column Code in file config and column Delete

filter2.xlsx (13.1 KB)

Please guide me about it.

Any idea for solve it?

you can use “REMOVE” instead of “KEEP”
and i think rather than using config(dictionary) u can use for each row and refer to the table on the excel file you prepared


@Ahmad_Rais How to use it?

Hi @fairymemay ,

Could you give this a try?

First we can create a lists of the items we want to delete like so →

dt_config.AsEnumerable().Where(Function(w) w("Remark").ToString.Trim.ToLower.Equals("delete")).Select(Function(s) s("CODE").ToString).ToList()

Then we can simply filter out the items using this →

dt_input.AsEnumerable().Where(Function(w) Not lst_itemsToDelete.Contains(w("Code_A").ToString)).CopyToDataTable()


DeleteRowsBasedOnConfig.xaml (7.5 KB)

Kind Regards,
Ashwin A.K

1 Like

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