Do-while loop until an array (index) becomes empty

Hi,

For a cell in Excel, I want to extract all the data separated by a comma into an array. But I don’t know how many data there are in a cell, so I don’t know how many loop are needed.

I think a Do-while loop can solve this. Once the array (index) becomes empty, the loop should stop.

Not sure how to write the condition.
Thank you

1 Like

Do-While Loop is not needed.

Read the cell into a string variable MyString

Then use Assign activity and write MyArray = MyString.Split(Char.Parse(","))

Hope that helps.!

1 Like
  1. Splitting the data by comma can be done by

Yourstring.Split(",").ToArray

  1. To Get the Count of Array Items
    NArray.Count.ToString

If you wanted to loop it , You can do it with the help of output from Step 1

If MyStr contains your delimited string and MyStrArr is the array of strings split on the , character:

MyStrArr = MyStr.Split(","c)

1 Like