Cull item with specific text and specific list lenght from a branch data

Hello dear community,

I need a little help to cull some tricky items from a data tree.
In specific I need to delete all the item of a branch data, conteining a specific text (per. example {28}) and all the branch data conteining per example only one item in the list.
I try with cull patter, but don´t work with this art of search.

Is this possible with the native GH components? any advice?
Cull

The data tree should not to be flatted

Thanks and best regards

Match Text with *{28} + Cull Pattern probably ?

Hello magicteddy, sadly MatchText only work if you match all the text of the item.
I had already tried.

No, you can use wildcards * for any string, or ? for a single wild character.

There is also Text Fragment if you want to extract a substring (the last 4 characters in your case)

2 Likes

Thanks a lot, I didn’t know this trick. Does this only work if I’m only looking to match only one item at a time? With a multiline list dont´work.

Both Text and Pattern inputs are as item, which means if you provide lists in both entries, the component will try to match the first pattern to the first text, then the second pattern to the second text, and so on.
If you really need multiple pattern to be tested on each item, you have to graft your Text input.

For the list length culling, here is a way :


MatchText-TextLength.gh (15.8 KB)

1 Like