I have some data in a messy nested list with many different (sub)-levels. I do not really care about these levels and just want the data in one big list of lists.
I've already looked for how to flatten a list of list or a nested list (for instance here, here and here), but solutions to those problems are not applicable here (I think).
So basically what I need is:
nested_list = [[[1, 2, 3], [[5, 6, 7], [8, 9, 10, 11, 23]]], [4], [[12, 13, 14], [[15, 16], [[17, 18], [19, 20]]]], [21, 22, 25, 26]]
unnested_list = nested_to_listoflist( nested_list )
#=> [ [1, 2, 3], [5, 6, 7], [8, 9, 10, 11, 23], [4], [12, 13, 14], [15, 16], [17, 18], [19, 20], [21, 22, 25, 26] ]
Any suggestions?