由于获得较好的处理机资源,因此将之前的数据整合到一起。

整合数据代码:

# coding:utf-8
# 由于获得较好的处理机资源,因此将之前的数据整合到一起。
#后面1000-2470页面全部整合到一起
import json

def add_to_one():
    cve_num1_file = open('D:/0test\中1000-1500页/cve_num0.json', "r")
    cve_num1_context = json.load(cve_num1_file)
    cve_inf1_file = open('D:/0test\中1000-1500页/cvebase_ifo.json', "r")
    cve_inf1_context = json.load(cve_inf1_file)

    cve_num2_file = open('D:/0test\中1500-2000页/cve_num0.json', "r")
    cve_num2_context = json.load(cve_num2_file)
    cve_inf2_file = open('D:/0test\中1500-2000页/cvebase_ifo.json', "r")
    cve_inf2_context = json.load(cve_inf2_file)

    cve_num3_file = open('D:/0test\尾2000-2470页/cve_num0.json', "r")
    cve_num3_context = json.load(cve_num3_file)
    cve_inf3_file = open('D:/0test\尾2000-2470页/cvebase_ifo.json', "r")
    cve_inf3_context = json.load(cve_inf3_file)

    t = [0]
    l0 = cve_num1_context+cve_num2_context+cve_num3_context+t
    l1 = cve_inf1_context+cve_inf2_context+cve_inf3_context

    with open('D:/0test/cve_num0.json', "w") as json_file:
        json_str = json.dumps(l0, indent=4)
        json_file.write(json_str)
        json_file.close()
    print('成功存储:D:/0test/cve_num0.json')
    with open('D:/0test/cvebase_ifo.json', "w") as json_file:
        json_str = json.dumps(l1, indent=4)
        json_file.write(json_str)
        json_file.close()
    print('成功存储:D:/0test/cvebase_ifo.json')

if __name__ == "__main__":
    add_to_one()


文件:

链接:https://pan.baidu.com/s/1m6vnI_Is5KRLdKmY40uJ5A 
提取码:【不公开】

发布了606 篇原创文章 · 获赞 1409 · 访问量 116万+

猜你喜欢

转载自blog.csdn.net/weixin_42859280/article/details/105362790
今日推荐