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:
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: xl65, width: 64"]AAA[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]2[/TD]
[/TR]
[TR]
[TD="class: xl65"]BBB[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]4[/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: xl65, width: 64"]BBB[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]3[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]5[/TD]
[/TR]
</tbody>[/TABLE]
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.:
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: xl65, width: 64"]AAA[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]AAA[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]2[/TD]
[/TR]
</tbody>[/TABLE]
Hopefully that explains it clear enough. Thank you in advance for the help.
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: xl65, width: 64"]AAA[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]2[/TD]
[/TR]
[TR]
[TD="class: xl65"]BBB[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]4[/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: xl65, width: 64"]BBB[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]3[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]5[/TD]
[/TR]
</tbody>[/TABLE]
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.:
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: xl65, width: 64"]AAA[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]AAA[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]1[/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"]2[/TD]
[/TR]
</tbody>[/TABLE]
Hopefully that explains it clear enough. Thank you in advance for the help.