|
|
|
@ -48,7 +48,7 @@ time = []
|
|
|
|
|
through = []
|
|
|
|
|
Num = 0
|
|
|
|
|
for i in result:
|
|
|
|
|
NUM = 0
|
|
|
|
|
NUM = 0
|
|
|
|
|
f = open('20.txt', 'w', encoding="utf-8")
|
|
|
|
|
f.write(i)
|
|
|
|
|
f.close()
|
|
|
|
@ -58,12 +58,11 @@ for i in result:
|
|
|
|
|
getOne = re.findall("\d{1,2}月\d{1,2}?日.*?。+(?=\d{1,2}月\d{1,2}日)|\d{1,2}月\d{1,2}?日.*?。+(?=病例)", data)
|
|
|
|
|
numname = 0
|
|
|
|
|
for i in getOne:
|
|
|
|
|
NUM += 1
|
|
|
|
|
NUM += 1
|
|
|
|
|
f = open('10.txt', 'w', encoding="utf-8")
|
|
|
|
|
f.write(i)
|
|
|
|
|
f.close()
|
|
|
|
|
data = openreadtxt("10.txt")
|
|
|
|
|
data = str(data)
|
|
|
|
|
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)
|
|
|
|
@ -80,16 +79,16 @@ for i in result:
|
|
|
|
|
while x < numdate:
|
|
|
|
|
date += date1
|
|
|
|
|
x += 1
|
|
|
|
|
i = 0
|
|
|
|
|
name2 = name1[0].split()
|
|
|
|
|
while i < numname:
|
|
|
|
|
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:
|
|
|
|
|
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()
|
|
|
|
|
t.close()
|
|
|
|
|