In Excel/Datatable Append some words in next column for certain rows till next word appears

HI all,
I need your support in getting the solution.

Data_New.xlsx (10.5 KB)

I need to add the word (specific array of words I have), if that appears then add that word in next column till next word appears in the column.
Please check sample attachment.

TIA,

@1a2bc346dgjk7544ebjkkbvf

Read the data into datatable dt and then add a column as required using add data column with name columnA

Now create a variable of type string and with initial value string.Empty and name it str

Then use for each row in datatable activity

Inside the loop use if condition with arrayitems.Any(function(x) currentRow(0).ToString.Equals(x))

On then side use assign with str = currentRow(0).ToStrinng

And on else side use currentRow("ColumnA") = str

After this loop all the values would be added…

Now use a filter datatabel and filter columnA is null …and then all the asia europe etc rows will be removed

Hope this helps

Cheers

1 Like

Thanks @Anil_G
Its working as expected :slight_smile:

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