def find_e_int(path, csvfile):
    """Gets the dispersion component of the interaction energy (per ion pair) for each configuration, each key of the groups dictionary. This value, when temperature corrected, is the enthalpy of interaction."""
    disp_contribution = 0.0
    elec = 0.0
    if path[0] == '.':
        config = path[2:]
    else:
        config = path
    with open(csvfile, 'r') as f:
        for line in f.readlines()[1:]:
            splitup = line.split(',')
            if splitup[0] == config:
                if len(splitup) == 15 or len(splitup) == 16:
                    disp_contribution = float(splitup[6])
                    elec = float(splitup[4])
                else:
                    disp_contribution = 0.0
                    elec = float(splitup[8])
    return disp_contribution, elec
