How to match Keywords

Hi All,

I have keyword in below format:
Day,Night,Afternoon,Evening
Black,Blue,Night,Green,Yellow
Red,Pink,Day,Afternoon

I need to compare all the keywords from line 2 and 3 with the keywords mentioned in line 1 and Extract the keywords that are matching with line 1. E.g Night from line 2 is matching with Line 1 and Day & Afternoon from line 3 is matching with the keywords present in LINE 1. Please suggest method for this.

1 Like

Hi @Anamika15

Try to split the words and do the comparison

Thanks
Ashwin S

1 Like

Fine
Let’s take like
Str_input = β€œ Day,Night,Afternoon,Evening
Black,Blue, Night ,Green,Yellow
Red,Pink, Day , Afternoonβ€œ

Now use a assign activity like this
arr_str = Str_input.Split(Environment.NewLine.ToArray())
Where arr_str is a variable of type array of string

β€”now use another assign activity like this
list_str1 = (Split(arr_files(0).ToString,”,”).Intersect(Split(arr_files(1).ToString,”,”)).Tolist()

and

list_str2 = (Split(arr_files(0).ToString,”,”).Intersect(Split(arr_files(2).ToString,”,”)).Tolist()

Where list_str1 and list_str2 is a variable of type list of string with default value as New List(of string) defined in the variable panel

Cheers @Anamika15

first take the second line split with , then loop through it and then you will get each item then check condition that item exist in line1 by line1_varible.constain(item) if this tru means that item is there in line 1 so store in another variable

1 Like

Thanks for the response.
Actually these lines are the part of excel workbook as mentioned below:
image

1 Like

Then we can get them with assign activity
Where we can save the in a string variable Like this
str_var1 = dt.Rows(rowindex)(columnindex)
Where both rowindex and column index starts from 0 for first row and first column
Cheers @Anamika15