Create Sublist at certain instance

Hello again!

I am working on a script to automate Beam Mark id and have hit a bit of a challenge.

I would like to create a Sublist every time this list contains the value -1. at the right i have the desired result.

Can anyone help?

Kind Regards!!!

The objective of the forum is not to do the work for others,
More help if ever at some point you are stuck on a process on everyone’s free time, given the speed of the second post I don’t know if you really had to look (the benefit of the doubt)
Here is a ‘‘solution’’ or approach
it didn’t take me 1 minute, like what when you try you end up finding (resilience and time)
edit:
image
Sometimes even while spending time, you provide a big dung too,
(morality either you drop everything and tell yourself it’s not for you, or either try again try again it depends on everyone, but at least for the guy who took the time to lift the hare (your shit in fact)) , you try again and normally in the more or less long term, you progress)

Have a good evening

cordially
christian.stan

1 Like

Careful here. You’re getting the right output only because your list length is less than your chop length and the first item always happens within a “working” range. The chop length wouldn’t be equal to the sum of an indexed sequence. It would be equal to the number of “steps” between items.

1 Like

You would have to convert index to length (+1) and then find the difference between the current index and the previous start/end point.

1 Like

Really appreciate your help!

Kind Regards!