I have a user parameter getting a string of comma separated words. I would like to use that as items/arguments to filter whether or not a feature attribute contain one of those words.
It would be to be used on about 10,000 features eventually with maybe up to 5 different words
I can get the user parameter to a list, and then to an attribute, but I can't find a way to use those to filter my dataset, either using Like, In, or Contains
Any idea how this can be done?
It's basically to filter whether a path does or not contain some words
Best answer by takashi
Hi @ts_84 , I think the "Contain Regex" operator would help you.
StringReplacer: Replace every , (comma) within the parameter value with | (pipe). The resulting string can be interpreted as a regex "word1|word2|word3", which matches one of the words.
FeatureMerger: Merge the regex attribute to every feature read from CSV unconditionally.
Tester or TestFilter: Test if "_full_path" string contains a part that matches the regex, with the "Contain Regex" operator.
The attached screenshot illustrates an example of implementation.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Hi @ts_84 , I think the "Contain Regex" operator would help you.
StringReplacer: Replace every , (comma) within the parameter value with | (pipe). The resulting string can be interpreted as a regex "word1|word2|word3", which matches one of the words.
FeatureMerger: Merge the regex attribute to every feature read from CSV unconditionally.
Tester or TestFilter: Test if "_full_path" string contains a part that matches the regex, with the "Contain Regex" operator.
The attached screenshot illustrates an example of implementation.
Hi @ts_84 , I think the "Contain Regex" operator would help you.
StringReplacer: Replace every , (comma) within the parameter value with | (pipe). The resulting string can be interpreted as a regex "word1|word2|word3", which matches one of the words.
FeatureMerger: Merge the regex attribute to every feature read from CSV unconditionally.
Tester or TestFilter: Test if "_full_path" string contains a part that matches the regex, with the "Contain Regex" operator.
The attached screenshot illustrates an example of implementation.
Thank you @Takashi Iijima , this works perfectly.
It's quite interesting to see Regex can work so simply like that too. And I didn't know a simple '1' would merge feature so easily either. Thanks for your valuable input