I am working on a project with baseball data from retrosheet.org. I want to create variables for the score of each team in each inning (VisInning1, HomeInning1, VisInning2, HomeInning2, etc). The problem is that the variable for the box score is coded strangely. Each team has its own variable for the whole game and each inning gets one value. Because leading zeros are cut off, a value of "12(10)1X" would mean that a team did not score in the first 4 innings, scored once in the fifth, twice in the sixth, ten times in the seventh, once in the eighth, and they did not have to play the ninth because they had won by that point. There is a variable for the total number of outs, so I can calculate whether or not there are extra innings.This is part of a project that I am doing as a gift for my father's 64th birthday in August. He's a huge baseball fan but likes leaving games early to beat the traffic. I'm writing an analysis of the likelihood of a leader change under different score conditions.