I am just wondering if it is possible to reorder words in a string.
I have a string consisting of various substances (a,b,c & other etc) listed alphabetically. I have just replaced "other" with the substance specified in another field. The problem now is that the list is not in alphabetical order, which is important for us.
Is there any way of getting the substances back in alphabetical order? For example by expanding them and then collapsing them again alphabetically?
Thanks for the question. One way to do this would be to use the Tokenise/Detokenise blocks. I've posted an example below:
Lets say we have some data as follows:
We want to replace value "FFF" with "BBB" in the "Tags" field. Firstly we use a De-Tokenise block to create a separate record for each token:
Then we use a Search/Replace block to replace the "FFF" tag with "BBB":
Now the values are in the wrong order, so we use a Sort block to ensure they are the right order. Note: We must select "Id" field as well as the "Tags" field to ensure the Id order is retained:
Finally to get the data back to it's original format we can use the "Tokenise" block:
So we have replaced one of the values and re-sorted the values back to alphabetical order.