Filtering list by items from another list

Hi,
I am trying to filter the files from a directory whose names contain an element from another list and move them to another directory, which is also selected by the same number in the name.

I am only at the beginning and already got stuck…

When I use the list.contains node to search for files with the (xxxxx - number from the second list) it returs value false to all items, eventhough some of them contain it.

I am new to dynamo, so I would appreciate a clear explaination :slight_smile:

Hello @marzena.goldyn , welcome to the Dynamo form
I don’t understand your actual problem,
but i can give one concept for this type of problem,
if you need any other help, then i can suggest you to reduce your sample data, suggest you ideal solution you are expecting from the script. then i can help you in a better way.

Hi,
Apologies - English is not my first language :slight_smile:

Ok, so I’ve reduced the data sample, as you’ve suggested and I’ve changed the node list.contains on string.contains.
Now I can find the item with a specific number in the list, but I would like it to find all the files that contain a 5 digit number in brackets (from 10000 to 15000). I’ve tried the list as a “search for” argument but it doesn’t work.
I hope now it’s more clear what I am after.

Please focus on the filtering filles by the GOLD no group.

1 Like

@marzena.goldyn See if this helps:

For those of us using older versions without the “List.AnyTrue” node… you can use this approach:

list - find this or that.dyn (16.4 KB)

1 Like

Hello @marzena.goldyn ,
Yes, same script will give you all the item which contain searching item from the main list.


Home.dyn (16.3 KB)

Hi!
Many thanks for help to all :grin:
I’ve adopted @Bren 's solution and I got what I wanted.

1 Like