Yes, good point it is somewhat similar. With this one the two items are floating around within a zone so I was taking a different approach. The script works as long as there is always a Date: in the zone. If the Date: falls outside the zone or is missing I get a Cannot call method “indexOf” of undefined: 1 error .
Your code takes for granted that there are always 8 lines in the data you’re extracting ( “for(i=0;i<=7;i++)”). So if there are only 7 items, then Zone[7] is undefined… which is why you get an error stating the method indexOf() cannot be called for undefined. You loop logic should be: