简体   繁体   English

如何在python中打开多个doc文件并从中解析电子邮件ID并写入csv?

[英]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.

相关问题 Python 3.6。 如何在for循环中遍历多个列表,然后使用DictWriter()将它们写入CSV文件 - Python 3.6. How to iterate over multiple list in a for loop and write them to a CSV File using DictWriter() 如何使用BeautifulSoup解析多个表并将其保存到csv文件 - How to parse multiple tables using BeautifulSoup and save them to a csv file 如何从 a.txt 文件中读取某些字符并将它们写入 Python 中的 a.csv 文件? - How can I read certain characters from a .txt file and write them to a .csv file in Python? 如何只用python写1个csv文件而不是多个 - How to write only 1 csv file and not multiple with python 如何使用Python和XSLT文件迭代解析巨大的XML并写入CSV - How to parse huge XML with Python and XSLT file iteratively and write to CSV 一次打开CSV文件,然后从循环python向其中写入几行 - open a CSV file once and write several lines to it from a loop python 如何通过python解析CSV文件的分隔列并使它们成为CSV文件的一部分 - How to parse a delimited column of a CSV file and make them be part of CSV file by Python 如何从具有 python 文件列表的单个文件中打开多个文件以及如何对它们进行处理? - how to open multiple file from single file which is having list of files in python and how to do processing on them? 如何从python中的生成器写入.csv文件 - How to write in .csv file from a generator in python 从 csv 文件中分离出多行的 Column,并在 Python 中对它们进行排序 - Seperate a Column with multiple lines from a csv file and order them in Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM