Merge the sub-indices in grasshopper

I have a list starting at index 1 and i want to merge the {i,j} index into just {i} by combing all the sublist into one line as shown in below snip. grasshopper list also attached.
Also I want to bring and attach the first number at the last of the list


List.gh (3.2 KB)

Have you tried text join

2 Likes

nope. just tried, it is working, but how can i bring first number at last

Split the text again, use list item to get the first and insert item to put it at the end

1 Like

it worked gain. how can I remove ‘,’ if it is at the end of string. like in string at index 2 : 7,6,1, to be updated to just 7,6,1 with no comma at the end

thanks @leopoldomonzani , why I am not getting this E(dot)

If you are referring to the point display it is an option of the Persistent Data Editor plugin.
I attach definition.
comma.gh (9.8 KB)

1 Like

Thank a lot to both! It is resolved now @leopoldomonzani and @martinsiegrist

1 Like

You can also use Deconstruct Path, interestingly despite the seperator being a comma instead of a semi-colon. The advantage here is that it will not create <\empty>s after trailing commas.


List vr1.gh (30.9 KB)

Alternatively, you can force the result from Text Split into a integer container and then Clean Tree. The integer container will go red because of the <\empty>, but will convert the empty to a <\null>.