I have a string cell with comma separated items. Some of them are double entries. By using the cell splitter I am able to remove the doubles using the "Output ... as set" option. Ultimately I would like the output as a normal concatenated string. Is there an easy way to convert the set back to a regular concatenated string?
you can ungroup the set column by using the Ungroup node. Afterwards you can use the GroupBy node with Concatenate as aggregation operation to create the concatenated string.
I used Simons approach in combination with two string replacer nodes to get rid of the brackets. Ungroup would also multiply all the other columns which is not so convenient for large tables. I still hoped there would be a single node solution. A Java Snippet also came to my mind but I could find a conversion command.
String[] r = c_Data; //(Set this to be your data column)
String t = "";
String delim = ", "; //Put whatever you want you deliminator to be here!
Boolean isFirst = true;
for (String elem : r){
t += (isFirst) ? elem : delim + elem;
isFirst = false;
}
o_Data = t; //(Set this output column to overwrite your data column)
NB - This will say it fails for empty input cells - giving a missing output cell, which is probably fine!
You could take this one step further, and convert your string to a set and then the set to a string all within the snippet!