[英]How to open multiple doc file in python and parse email ID from them and write in csv?
我想从 1000 个 word 文档文件中提取电子邮件 ID 并在 python 中生成一个 csv 文件。
If your problem is detecting Email Address ,this Regex
code will help you:如果您的问题是检测电子邮件地址,此正则
Regex
代码将帮助您:
[\w\.-]+@[\w\.-]
and you should use it in python like this:你应该像这样在 python 中使用它:
import re
out= re.findall(r'[\w\.-]+@[\w\.-]+', YourTextFile)
print(str(out))
and the other part for reading csv or writing in it you can use this link .另一部分用于读取 csv 或写入其中,您可以使用此链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.