def search_key(lines,key,strict=False,get_value=False):
    """ Search through the list of text lines for the line containing the key
    if strict: match line == key
        else: line contains key
    if get_value==True, also return the value"""
    i = 0
    while True:
        if (strict and lines[i].strip()==key) or (not strict and lines[i].find(key)>-1):
            break
        else:
            i += 1
    line = lines[i]
    if get_value:
        try:
            val = float(line[line.rfind(':')+1:].strip())
            return i, val
        except:
            return i, None
    return i