def parse_to_var(data, var, stoptag=''):
    """ Parses a variable 'var' from 'data'.

    :returns: (out,i) tuple
    out - the rest of the line with 'var' and a " " removed. If nothing is followed, then True is returned.
    i - number of lines parsed.
    """
    out = {}
    i = 0
    if type(data) is str:
        data = data.split()
    for line in data:
        if line.find(stoptag) > -1:
            break
        items = line.split()
        if items[0] in var:
            if len(items) > 1:
                out[var[items[0]]] = line.replace(items[0] + ' ', '')
            else:
                out[var[items[0]]] = True
        i += 1
    return out, i
