I have a column numbered so...
1
0
0
0
1
0
1
0
0
1
1
0
0
0
0

I would like the next column to number consecutively, starting at 1 each time a 1 is encountered, so my columns would be...
1 1
0 2
0 3
0 4
1 1
0 2
1 1
0 2
0 3
1 1
1 1
0 2
0 3
0 4
0 5

and so on.

I'm at a loss to get this done. Any ideas?

TIA