From da71af75a8a6850e7697ffdfbc8232b3957dc3f0 Mon Sep 17 00:00:00 2001 From: p6rwc4fxp <2277472491@qq.com> Date: Wed, 27 Apr 2022 18:26:31 +0800 Subject: [PATCH] Update getdata.py --- getdata.py | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/getdata.py b/getdata.py index 25a52cc..a95d76d 100644 --- a/getdata.py +++ b/getdata.py @@ -62,36 +62,4 @@ NUM = 0 f = open('10.txt', 'w', encoding="utf-8") f.write(i) f.close() - data = openreadtxt("10.txt") - data = str(data) - date1 = re.findall("\d{1,2}月\d{1,2}日+(?=,)", data)[0] - date1 = date1.split() - time += re.findall("\d{1,2}:\d{1,2}--\d{1,2}:\d{1,2}|\d{1,2}:\d{1,2}", data) - updateFile(r"10.txt", "[0-9月\'\",:-]", "") - updateFile(r"10.txt", "日,", "。") - data = openreadtxt("10.txt") - data = str(data) - t = re.findall("(?<=。)+.*?。", data) - through += t - numdate = len(t) - Num += numdate - numname += numdate - x = 0 - while x < numdate: - date += date1 - x += 1 - i = 0 - name2 = name1[0].split() - while i < numname: - name += name2 - i += 1 -num = range(0, Num) -rows = zip(num, name, date, date, time, through) -with open("test.csv", "w", encoding='utf-8', newline="") as t: - writer = csv.writer(t) - writer.writerow(["", "病例", "开始日期", "结束日期", "时间", "事件"]) - for row in rows: - writer.writerow(row) -t.close() -#方法 -#测试加入代码 \ No newline at end of file + \ No newline at end of file