import re


def file_to_array(file_name):
    """Read file and extract lines to list. 

    Parameters
    ----------
    file_name : str
        Path of file to read.

    Returns
    -------
    array : list
        List of lines contained in file.
    """
       
    with open(file_name, 'r') as f:
        array = [line.strip() for line in f]
        array = [line for line in array if line]
        array = [line for line in array if not re.match('\#',line)]

    return array