def get_ttylog_lines_from_file(ttylog):
    """Read from ttylog. If lines have '\r' at end, remove that '\r'. Return the read lines"""
    ttylog_file = open(ttylog,'r',errors='ignore', newline='\n',encoding='utf-8')
    ttylog_read_data = ttylog_file.read()
    #Replace escaped double qoutes with qoutes
    ttylog_read_data = ttylog_read_data.replace(r'\"','"')
    ttylog_file.close()
    ttylog_lines = ttylog_read_data.split('\n')
    ttylog_lines_file = []

    for line in ttylog_lines:
        if len(line) > 0:
            if line[-1] == '\r':
                ttylog_lines_file.append(line[:-1])
            else:
                ttylog_lines_file.append(line)

    return ttylog_lines_file