def parse(cond):
    """parse file and return lines/values"""
    
    check = True
    testcond, value = cond.next()
    for line in file(INPUT_FILE):
        if check:
            if line == testcond:
                yield value
                try:
                    testcond, value = cond.next()
                except StopIteration:
                    check = False
            else:
                yield line
        else:
            yield line
parse file and return lines/values
recipes/Python/440523_Text_transformer_with_conditions/recipe-440523.py