Parsing a string of words, separated by a comma

Hi all,

I have a structured sentence of 10 words, separated by a comma, let’s say:
Red, blue, green, yellow, purple, orange, pink, turquoise, indigo, violet.

I need to separate them into individual values to add each one to their respective columns in Google Sheets.

What is the best way of parsing those values and returning them individually?

Thanks!

Hi @karla,

You can do it quite easily by combining the split() function with the get() function. Like this:

I made a dummy variable that holds your text: pureText:
image

I then split() this, and wrap the split in a get() function, to get the n-th item.

image

{{get(split(2.pureText; ","); 2)}}

The 2 and 4 in these functions, get the 2nd and 4th item. So you can do that with any number.

You can also wrap the split() in a first() or last() function to get the first and last item:
image

Result:
image

Hope that helps!

2 Likes

Hi @karla

With this you will get each word as seperate bundle and then you can add the word to sheet directly
Inside the set variable I have passed the text

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

3 Likes