Divide flat list A into - branches based on other list B

Hi,

Question;

There is;
List A = a flat tree
List B =a tree with branches

The total number of items in both lists are the same.

Challenge;
I would like to ‘break’ list A into the same branche structure as List B.

Any suggestions?

Thanks

2020-11-03 Split list into branch names of other list.gh (7.6 KB)

You will have to graft your first list and then replace the path structure from List A with the path structure of List B.

2020-11-03 Split list into branch names of other list.gh (19.3 KB)

Hi,

Thanks for your quick response.
Only thinsg is, that it is also possible that there are 2 items in 1 branch. (whereby the graft does not work anymore).

I am quite sure there is a component for it that does ‘mirror/cut into defined branches of other list’ but I dont know the name anymore…

any suggestions?

thanks :slight_smile:

Match Tree might help.

If not, post an example.

2020-11-03 Split list into branch names of other list.gh (16.3 KB)

…you can simply use Unflatten

3 Likes

Ahh perfect!

Thats it! thanks! :slight_smile: