def get_N_lB(filepath):
    """
    Returns the degree of polymerization N and Bjerrum length lB from filepath.
    *Assumes symmetric polymers.

    Parameters:
    -----------
    filepath : string
        Full filepath to data file
    ext : string
        Extension for data file, including period
    Returns:
    --------
    N : int
        Degree of polymerization
    lB : float
        Bjerrum length (non-dimensionalized by sigma, bead diameter)
    """
    # extracts filename from filepath
    folder = filepath.split('\\')[-2]
    # extracts N
    i_N_begin = folder.find('NA')+len('NA(')
    i_N_end = folder.find(')NB')
    N = int(folder[i_N_begin:i_N_end])
    # extracts lB
    i_lB_begin = folder.find('lB(') + len('lB(')
    i_lB_end = folder[i_lB_begin:].find(')') + i_lB_begin
    lB = float(folder[i_lB_begin:i_lB_end])

    return N, lB