【小工具】1.需要对txt存放的测试数据做去重处理
发布时间:2021-05-21 04:57:20 所属栏目:大数据 来源: https://www.jb51.cc
导读:采用集合去重,在新文件里逐行写入,达成目的 old_file = "D:/testdata/memberId.txt" #oldresult_file = "D:/testdata/memberId_new.txt" #newlines_seen = set()out_file = open(result_file,"w")f = open(old_file,"r")for line in f: if line not in lin
采用集合去重,在新文件里逐行写入,达成目的 (编辑:北几岛) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |