def read_elemnames(filename, delimiter='\n'):
    """
    A helper function to read element names from text files into a list of strings.
    Standard input is a text file with linebreaks between elements.

    Parameters
    ----------
    filename : str
        input file name
    delimiter : str
        (Optional) which separator to use for elements,
        default is the (unix) linefeed (which also works for windows linefeeds)
    """
    with open(filename) as fi:
        contents = fi.read()
    element_names = list()
    for elem in contents.split(delimiter):
        elem = elem.strip()  # this also removes \r in case of \r\n linefeeds
        if len(elem) > 0:
            element_names.append(elem)
    return element_names