import re


def prase_data(content, fields_count):
    """
    解析数据
    :param content:文件内容
    :param fields_count:diff字段数
    :return: [(,),(,),...]
    """
    try:
        # 如果匹配的内容中包含\r\n类东西，要用[\s\S]+?
        pat = re.compile(r'[~]' + '[\n]{0,}([\s\S]+?)[~][\n]{0,}' * fields_count )
        outs = re.findall(pat,content)
        return outs
    except Exception as e:
        return []