def _getheaderlines(record):
    """Read the header file and separate comment lines
    and header lines"""
    hfile = record + '.hea'
    all_lines = open(hfile, 'r').readlines()
    comment_lines = []
    header_lines = []
    # strip newlines
    all_lines = [l.rstrip('\n').rstrip('\r') for l in all_lines]
    # comments
    for l in all_lines:
        if l.startswith('#'):
            comment_lines.append(l)
        elif l.strip() != '':
            header_lines.append(l)
    
    return header_lines, comment_lines