Filename keyword match with Excel scenario

I have a file.
The filename has a keyword. I have another file which is an excel of 10,000+ rows(2 Columns : Keyword and Type). I want to loop through the excel and fetch the corresponding type of the keyword from excel .

@Leo_Hope try this

dt_test is the datable which contains your excel data.

dt_test.AsEnumerable.Where(Function(r) Path.GetFileNameWithoutExtension(filename).ToLower.Contains(r("Keyword").ToString.ToLower)).Select(Function(r) r("Type").ToString).FirstOrDefault()

It works @muktadir . Thank you

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