Hello, I'm trying to figure out a way to better process the data that another program that I use spits out. It gives me a list of numbers with breaks in them and I need to be able to add up all of the numbers just in the contiguous blocks of numbers like this:
<tbody>
</tbody>
So for this example I would need to get the answer of 4 for the first group and 7 for the second and something that would work with any arbitrary sized list. Also, sometimes it'll break apart a list (though not at a consistent length) so you'll get another list like this below the last:
<tbody>
</tbody>
So in this case then I'd be a huge help if it could see that an identical list was started previously (or that one follows) and instead return a result of 15. They will be consecutive so it's not like you'll see AAA;BBB;CCC;BBB or anything like that but there are times where it posts empty sets as well i.e.:
<tbody>
</tbody>
Hopefully that explains it clear enough. Thank you in advance for the help.
AAA | |
1 | |
1 | |
2 | |
BBB | |
1 | |
1 | |
1 | |
4 |
<tbody>
</tbody>
So for this example I would need to get the answer of 4 for the first group and 7 for the second and something that would work with any arbitrary sized list. Also, sometimes it'll break apart a list (though not at a consistent length) so you'll get another list like this below the last:
BBB | |
3 | |
5 |
<tbody>
</tbody>
So in this case then I'd be a huge help if it could see that an identical list was started previously (or that one follows) and instead return a result of 15. They will be consecutive so it's not like you'll see AAA;BBB;CCC;BBB or anything like that but there are times where it posts empty sets as well i.e.:
AAA | |
AAA | |
1 | |
1 | |
2 |
<tbody>
</tbody>
Hopefully that explains it clear enough. Thank you in advance for the help.