Array and CSV compare

Hi Guys,

I have an existing array(anArray) with values {“WEBSERVER”, “PORTAL”, “SEARCH”}

In addition I have an existing CSV file with column named “SCENARIO”

How to compare if one value from the array is existing in the column “SCENARIO” in a csv file?

Please let me know


What do you want to achieve? Do you want an output of the count of occurrences for each value of the array? Do you want to have an action each time one of the values occur?

A simple output of a message box which says a match has been found would be using a For Each Row activity against the CSV file.

Then against each row use the If Activity which has the condition.


If the answer is True THEN print a message “Match”, ELSE leave blank

the following code snippet will return you the List(of System.Data.DataRow) generic collection
the words is your input array, and the dtInput is the csv file data.
the “Details” is the column I want to check for the array values.

(From row In dtInput.AsEnumerable() Where words.Contains(row.Field(Of string)(“Details”)) Select row).ToList()