Remove spaces and remove a value

Hello,

I basically have a data that looks like the below:
6742792667373, 6746172424429, 6749208183021

Basically, I want to remove space between each comma and also remove one value for eg: 6746172424429

What i tried:

  1. I used trim() to remove space
  2. To remove a value 6746172424429 i used remove(6742792667373, 6746172424429, 6749208183021;6746172424429, ) but it was trowing a error. ( screenshot attached below )

image

1 Like

I think if you use the split() function on that, the result will be an array of three values. That function should also automatically trim spaces.

So for
Data = 6742792667373, 6746172424429, 6749208183021

The result is an array that looks something like this:
split(Data;,) =
[1] = 6742792667373
[2] = 6746172424429
[3] = 6749208183021

4 Likes

I am able to trim but not able to remove a data from the array

image

And how to i remove the below
image

Thanks

If it’s the same every time, you should be able to use the remove() function on that array and remove that specific value.

Here are three items in an array:
image

Then the remove() function on it:
image

And the result:
image

If you’re removing whatever value is in that position (position 2) then that’s a different story…

3 Likes

My mistake! Thought you were working with arrays, but it’s just text.

In that case, if you’re with that entire body text, just use the replace() function a couple times. So if you start with:
image

Then this function will remove that middle value and the spaces:

{{replace(replace(6.value; space; emptystring); “,6746172424429”; emptystring)}}

Leaving you with:
image

If you’re dealing just with the set of values, another way to handle it is to split the string up, remove that value, then put the rest back together, separated by commas:

{{join(remove(split(6.value; “,”); 6746172424429); “,”)}}

3 Likes