def find_keyword(ascii_file, keyword, max_lines = None):
    """Looks for line starting with given keyword; file pointer is left at start of that line."""
    start_pos = ascii_file.tell()
    while True:
        if max_lines is not None:
            if max_lines <= 0:
                ascii_file.seek(start_pos)
                return False
            max_lines -= 1
        file_pos = ascii_file.tell()
        line = ascii_file.readline()
        if len(line) == 0:
            ascii_file.seek(start_pos)
            return False  # end of file
        words = line.split()
        if len(words) > 0 and words[0].upper() == keyword.upper():
            ascii_file.seek(file_pos)
            return True