From 2648afd9583c0e1a41c70fe07e18a53cb932dc55 Mon Sep 17 00:00:00 2001 From: p2tfsuw8f <2517759664@qq.com> Date: Mon, 25 Apr 2022 20:17:32 +0800 Subject: [PATCH] Update getdata.py --- getdata.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/getdata.py b/getdata.py index e4902ba..7666cdb 100644 --- a/getdata.py +++ b/getdata.py @@ -30,4 +30,21 @@ def updateFile(file, old_str, new_str): os.remove(file) os.rename("%s.bak" % file, file) f2.close() - f1.close() \ No newline at end of file + f1.close() + +updateFile(r"test.txt", ";", "。") +updateFile(r"test.txt", ":", ":") +updateFile(r"test.txt", "-", "--") +updateFile(r"test.txt", "确诊病例", "") +updateFile(r"test.txt", "病例轨迹", "") +updateFile(r"test.txt", "病例", "&&病例") +updateFile(r"test.txt", "呼和浩特市应对新型冠状病毒感染", "end") +data = openreadtxt('test.txt') +data = str(data) +result = re.findall("病例\d:.*?(?=&&|end)", data) +name = [] +date = [] +time = [] +through = [] +Num = 0 +for i in result: \ No newline at end of file