Dear all:

I have a problem when dealing with my data, for one variable. There is only "1","2", and "0", I want to find the first "1", and then find the next "2", then find the next "1",and so on like the following example:
from the right to the left
0 0
0 0
1 1
1 0
1 0
1 0
0 0
1 0
2 2
2 0
1 1
1 0

Thank you!
Best wishes