import re


def load_txt_to_dict_kv(filepath, delimiter = ','):
    """Given a filepath, load the contents in the format key,value into a dictionary in the format (key:value)
        Keyword arguments:
            filepath -- path to text file
            delimiter - type of delimiter to be used, default value is ','
    """
    d = {}
    with open(filepath) as f:
        for line in f:
            if not line.startswith("#"):
                line = re.sub('\n', '',line)
                (key, val) = line.split(delimiter)
                d[key] = val
    return d