def split_scenarios(scentime, scencmd):
    """ Split the contents of a batch file into individual scenarios. """
    start = 0
    for i in range(1, len(scencmd) + 1):
        if i == len(scencmd) or scencmd[i][:4] == 'SCEN':
            scenname = scencmd[start].split()[1].strip()
            yield dict(name=scenname, scentime=scentime[start:i], scencmd=
                scencmd[start:i])
            start = i
