Keep list items

Hello all,
I’ve extracted a list with all the texts in a file and got only the ones who matched a pattern.
Now I’m struggling to keep the same index of the first list…
Can someone help me?


recup points (169.6 KB)

You didn’t upload your Rhino file so I can’t really test this, but think this may be what you are looking for.


Thank you for your answer but no, in fact I want to filter a list (the one of the texts) using only the values in the field Match Text, but keeping its original item numbers.
Here’s the .gh with internalized curves and a .csv file with the values (I could’n know how to internalize the texts in Rhino…).
altimétrie.csv (21.2 KB)
recup points topo (273.1 KB)

If I understand what you’re asking, you want to extract the values that match your pattern and maintain their index numbers. I don’t think this is possible - list indices always run from 0 to 1 less than the number of items in the list. I suppose you could replace the items you don’t want to keep with nulls.

The CSV file you uploaded has all numeric values with the exception of 3 lines. Some of the values do not have a decimal point or following digits.

Feed the “text” output of your script component to a Text component (Params → Primitive → Text) then right-click the Text component and select “Internalise data”.

You can build more flexible search patterns by using regular expressions as I have shown here. (32.0 KB)