Problems with lists! Help! I do not remember

how can i separate and index a list?
the list I have in a variable looks like this:
["%", "alex", ["3", "5", "7"], "%", "tom", ["5", "6", "7"], "%", "jon", ["33", "53", "7"], "%", "foo", ["46", "66", "76"]]

I would like the symbol "%" to break to put an index.
I would like to create something like this:
1)alex, ["3", "5", "7"]
2)tom , ["5", "6", "7"]
3)jon, ["33", "53", "7"]
4)foo, ["46", "66", "76"]

how you do it?

Hello Piero

Maybe this way also,

infinite thanks to both of you for your suggestions !!
looking at the images of the blocks I have the impression that my problem would not be solved if I applied these suggestions!
So, I think I haven't explained my problem well!
I have no trouble removing the "%" symbol from my list, or splitting the list into the item I want! my goal is to divide the list and assign an INDEX to each piece of the list thanks to which it is possible to recall this piece of the list as I wish at other times in my app!
I don't think the code you suggested does this, right? or did I not understand it well?
many years ago (with app inventor 1) i did such a thing but i don't remember how .... i used a "for each" or maybe more than one (nested) and maybe an "index in list" block .. but I am very confused because too many years have passed, so I was asking you for help!

hope to solve with the help of all of you, thanks !!

Maybe dictionary can organize you data well.

If you are using a dictionary, the names look unique.
I would use the names as the keys with the 3-number lists as values.

By the way, this should have been done upstream, instead of building that weird one dimensional list.

I did not know of the existence of such blocks! they are old, I guess !!
I think it does this code for me !!
can you share the .aia file?


This will return the "output" format you require in a label:


Yes, I do prefer this structure only, but I just follow what was prefered.

@ABG But what if in a Class there are two student having same name, maybe the case. It look like names are associated with marks for three subject. RollNumber or Registration Number look more unique.

and @PiERO, no I dont have aia because I don't think good to have a aia for each and every excercise, but you can reconstruct it, because you need to adapt them accordingly.

That is exactly what a Block List delivers, index starting @ 1. So it works like this:

i did as suggested by TOMAI2 but it doesn't work! where am i wrong?

Not quite as I suggested :slight_smile:


In the last two set Label.text it should be item not contatore

sorry, you are right!! now it is OK!!