Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import os
- import re
- #fetching the mail adress through indexnumber out of the list
- with open('Protected/Protected G.txt', 'r') as file:
- #creating the regex pattern to sort out the mail adresses
- rgx = 'S+@S+'
- #read the file and convert the list into a string
- content = file.readlines()
- content_str = ''.join(content)
- #get the mails out of the "list" with regex
- mails = re.findall(rgx, content_str)
- #put each mailadress in a variable
- for item in mails:
- print(item)
- Dummy-Dataframe:
- Forename Last Name Email Protection
- 1 John Kennedy John@gmx.net
- 2 Donald Trump Donald@gmx.net
- 3 Bill Clinton Bill@gmx.net
- 4 Richard Nixton Richard@gmx.net
- Finished Dataframe:
- Forename Last Name Email Protection
- 1 John Kennedy John@gmx.net x
- 2 Donald Trump Donald@gmx.net o
- 3 Bill Clinton Bill@gmx.net x
- 4 Richard Nixton Richard@gmx.net x
Add Comment
Please, Sign In to add comment