Update getdata.py

master
pbz3hcxoe 3 years ago
parent d42b2e8d07
commit db6453701e

@ -72,23 +72,23 @@ NUM = 0
data = str(data) data = str(data)
t = re.findall("(?<=。)+.*?。", data) t = re.findall("(?<=。)+.*?。", data)
through += t through += t
numdate = len(t) numdate = len(t)
Num += numdate Num += numdate
numname += numdate numname += numdate
x = 0 x = 0
while x < numdate: while x < numdate:
date += date1 date += date1
x += 1 x += 1
i = 0 i = 0
name2 = name1[0].split() name2 = name1[0].split()
while i < numname: while i < numname:
name += name2 name += name2
i += 1 i += 1
num = range(0, Num) num = range(0, Num)
rows = zip(num, name, date, date, time, through) rows = zip(num, name, date, date, time, through)
with open("test.csv", "w", encoding='utf-8', newline="") as t: with open("test.csv", "w", encoding='utf-8', newline="") as t:
writer = csv.writer(t) writer = csv.writer(t)
writer.writerow(["", "病例", "开始日期", "结束日期", "时间", "事件"]) writer.writerow(["", "病例", "开始日期", "结束日期", "时间", "事件"])
for row in rows: for row in rows:
writer.writerow(row) writer.writerow(row)
t.close() t.close()

Loading…
Cancel
Save