Removing empty List items and branches with empty lists

Hi All,
I have seen this topic come up a few times, the removal of empty list items, and why cleaning a tree full of empty list items doesn’t remove a the branch.

For my own uses, i have put together a little cluster that allows three options. Following David Ruttens post on the topic some time ago - I will refer to list items as Twigs:

Options include:

  1. Remove empty twigs from a tree;
  2. Remove empty twigs AND resulting empty branches;
  3. Remove Branches made of empty Twigs (will retain empty twigs in a branch which where at least 1 twig is not empty).

I have attached the cluster below:

Remove Empty Twigs, or branches of Empty Twigs…gh (11.5 KB)

I haven’t extensively tested this, but its a simple cluster and should be easy enough to edit.

Note: The script uses text length to cull data, will also remove Null values because of the way its set up.

Possible to retain the null values with some edits - which i might build in as an option in future.

Hope its of use to someone in future :slight_smile:

1 Like