def create_metadata_from_segments_list(head_list, output_file):
    """
    Creates a csv file following the template: "filename | text"
        Parameters:
        head_list (str): Reference of the linked list of segments.
        output_file (str): csv output filename.

        Returns:
        String: returns True or False
    """
    separator = '|'
    curr = head_list
    try:
        f = open(output_file, "w")
        while curr is not None:
            text = curr.text
            filename = curr.filename.replace('.mp3', '')
            f.write(filename + separator + text[0] + '\n')
            curr = curr.next
        f.close()
    except IOError:
        print("Error: creating File {} problem.".format(output_file))
        return False
    return True