def read_schedule_cnt(file_name):
    """Read Schedule cnt file with well file definitions
    Args:
        file_name (str): File name for Schedule cnt file
    Returns:
        Dictionary of well files
    """

    try:
        infil = open(file_name, 'r')
    except OSError as e:
        errmes = 'Error opening file ' + file_name + '\n' + str(e)
        raise OSError(errmes)

    line_no = 0
    file_list = dict()

    while True:
        try:
            line = infil.readline()
        except IOError:
            errmes = 'Error reading Shedule cnt file, line ' + str(line_no + 1)
            raise IOError(errmes)

        if not line:
            break
        line_no = line_no + 1

        temp = line.strip()

        if temp == '':
            pass    # Skip blank lines
        elif temp.startswith('--'):
            pass    # Skip comments starting with --
        else:
            terms = temp.split()
            no_terms = len(terms)
            if no_terms > 3:
                if terms[0] == 'FILE' and terms[2] == 'WELLNAME':
                    file_list[terms[3]] = terms[1]

    infil.close()
    return file_list