Shorten a directory for cleanup

Ok I am trying to clean up my dynamo so it only sees the state name not the rest of the directory. also to filter out the unused. delete the red and only see the yellow for Data-Shapes

Assuming all your objects sit at same depth you could count the occurences of \ to filter those first few.

You could then split the strings using the \ character and take the second item from each sublist to get the two characters you’re seeking.

sorry to be dumb but can to illustrate it?

was able to remove the first 4 lines but feel this is a very bad (or not intelligent way of doing it lol)

OK part 1 done can anyone help with part 2

Unfortunately not at my computer currently, but if anyone else wants to try that’d be great. If you look under the string part of the node library there should be one for splitting I think… it should yield each string as a sublist of the strings divided at each occurence. From there you can use get item at index with the desired index, and set the list input to @l2 for levels. I may be mistaken and the string split node may be a custom one from my package (Crumple).

1 Like

This should get the parent directory name for any file system object (a directory or a file):

1 Like

for some reason the image comes out blurry can you resend it or the dynamo file Thanks for the help

I’ll try and repost from my work account (have to move the image across devices which appears to have down sampled the pic somehow).

1 Like

I got it (had to squint lol) now my issue is how to reconstruct it after it fires

Seals.dyn (74.4 KB)

Wahoo got it Thank you very much for all that helped me in the right direction. Here is the Dynamo if anyone wants to do the same thing. Its an electronic world so replacing the digital signature
is a minor task but it helps new employees to not have to search through the network.
Seals.dyn (67.7 KB)

1 Like

Well done!

Posting the higher quality image for reference:

1 Like