def split_format(fmtstring, s):
    """decode a bytestring and split and convert it by a given format code
    s: string, i: int, f: float, x: none

    Args:
        fmtstring: specifies the format of the string, eg 's4,i4,f14,f14'
        s: string to decode

    Returns:
        list: with results
    """
    decoders = {'s': str, 'i': int, 'f': float, 'x': lambda x: ''}
    s = s.decode(encoding='ascii')
    result = []
    for fmt in fmtstring.split(','):
        #print('fmt code ', fmt)
        result.append(decoders[fmt[0]](s[:int(fmt[1:])]))
        s = s[int(fmt[1:]):]
    return list(filter(lambda x: x != '', result))