I want to “interlace” multiple lists into a single multi-level tree and then “flatten” the tree into a single level.
After the first step, I want to have a tree that on branch {i, j, …, k} has a list with element i of the first list, element j of the second list, …, element k of the last list.
To better explain, lets say i have tree lists:
A, B, C
1, 2, 3, 4
a, b
I want a tree with:
A1a on branch {1,1,1}, A1b on branch {1,1,2}, …, B3b on branch {2,3,2}, … C4b on branch {3,4,2}
For a total of 3*4*2 = 12 branches.
Lastly I want to flatten everything into a single level tree with the lists on branches {1}, {2}, …, {12}.
I managed to do this with a python script (see the screenshot)
Honestly the goal was to show the results and I think the screenshot did exactly that. I did not need to debug my scripts and reverse engineering them looked like a more complex alternative than just looking at the screenshot.
Unfortunately it doesn’t work and you can see it in your screenshot: the lists do not “start over”.
The output of your version is (copied directly from GH):
{0;0;0;0}
A
1
!
{0;0;0;1}
A
1
?
{0;0;0;2}
A
2
?
{0;0;0;3}
A
2
?
{0;0;0;4}
A
3
?
{0;0;0;5}
A
3
?
{0;0;0;6}
A
4
?
{0;0;0;7}
A
4
?
{0;1;0;0}
B
4
?
{0;1;0;1}
B
4
?
{0;1;0;2}
B
4
?
{0;1;0;3}
B
4
?
{0;1;0;4}
B
4
?
{0;1;0;5}
B
4
?
{0;1;0;6}
B
4
?
{0;1;0;7}
B
4
?
{0;2;0;0}
C
4
?
{0;2;0;1}
C
4
?
{0;2;0;2}
C
4
?
{0;2;0;3}
C
4
?
{0;2;0;4}
C
4
?
{0;2;0;5}
C
4
?
{0;2;0;6}
C
4
?
{0;2;0;7}
C
4
?
So you have “!” in the first item, then “?” in all the following ones (e.g. you have “A2?” twice, but no “A2!”).
Same for the second list: you have two "1"s, two "2"s, two "3"s and then they are all "4"s