def read_from_txt(file_path):
    """read data from txt file
    signal content:
            % ...
            % ...
            float; float
            ...
    border content:
            int \t int
            int \t int
            ...

    Args:
        file_path (str): txt file path

    Returns:
        data (list): signal data(float) or border data(int)
    """

    with open(file_path, mode='r', encoding='utf-8') as f:
        flag = ""
        data = []

        lines = f.readlines()
        if lines[0].startswith("%"):
            del lines[0:5]
        if ";" in lines[5]:
            # 此时返回信号数据
            flag = "signal"
            for line in lines:
                tar = line.split(";")[1]
                data.append(float(tar))
        else:
            # 此时返回border数据
            flag = "border"
            for line in lines:
                begin, end = line.split("\t")
                data.append([int(begin), int(end)])

    return data, flag