LunaticFringe82
New Member
- Joined
- Dec 14, 2005
- Messages
- 3
As part of my analysis of major league baseball "game logs", I need to break down linescore strings, which vary in length.
The strings are presented as follows:
"100230000" - Means that the team scored one in the 1st inning, two in the 4th, and three more in the 5th. (If they were all like this, I wouldn't be posting here!)
"2001" - Means that the team scored two runs in the 6th and one more in the 9th (assuming that the game lasted nine innings, which can be determined elsewhere). Instead of leading zeros (to signify no runs scored in any of the first five innings), they just shorten the string.
"2001x" - Means that the team scored two in the 5th, one in the 8th, and then did not bat in the 9th because they are the home team and still led after the visiting team batted in their half of the 9th. Again, this assumes a nine inning game.
"1003(12)0011" - Means that the team scored one in the 1st, three in the 4th, TWELVE in the 5th, then one each in the 8th and 9th.
My goal is to break these into a grid that for every game provides a column containing the 1st inning value, 2nd inning value, etc.
I've been wracking my small brain (which doesn't know macros) with no success and hope that some of the larger brains could help me with this.
Thanks!
The strings are presented as follows:
"100230000" - Means that the team scored one in the 1st inning, two in the 4th, and three more in the 5th. (If they were all like this, I wouldn't be posting here!)
"2001" - Means that the team scored two runs in the 6th and one more in the 9th (assuming that the game lasted nine innings, which can be determined elsewhere). Instead of leading zeros (to signify no runs scored in any of the first five innings), they just shorten the string.
"2001x" - Means that the team scored two in the 5th, one in the 8th, and then did not bat in the 9th because they are the home team and still led after the visiting team batted in their half of the 9th. Again, this assumes a nine inning game.
"1003(12)0011" - Means that the team scored one in the 1st, three in the 4th, TWELVE in the 5th, then one each in the 8th and 9th.
My goal is to break these into a grid that for every game provides a column containing the 1st inning value, 2nd inning value, etc.
I've been wracking my small brain (which doesn't know macros) with no success and hope that some of the larger brains could help me with this.
Thanks!