【发布时间】:2018-07-16 22:06:12
【问题描述】:
我有一个包含如下数据的文本文件。我必须提取所有包含签名的行
The document was signed on July 12
The document was signed by Charlie
This document was assigned to John
The document was preassigned to Amanda
预期输出:
The document was signed on July 12
The document was signed by Charlie
如果我正在使用:
for line in file:
if "signed" in line:
print (line)
正在打印所有行
【问题讨论】:
标签: regex python-3.x spacy data-extraction