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