I have a big text file, let say :
random text Blabla blabla <aaa@gmail.com> bliblibli vlavlavla "bbb@hotmail.com" kakaka lolol <ccc@outlook.su.org> mamama pfdsfsdf random text
And I want to read it and extract all emails from it, and then stock them into an array.
The emails are always contained between <> or between "". And they always contains an @. But they dont always end with a .com. Sometimes they end with many dots (like the example of .su.org).
How can I do that in Python please ?
I tried this :
filepath = 'C://PROGRAMING//Outlook//test1.CSV'
with open(filepath) as file:
lines = file.readlines()
print(lines)
It show all the text, but in between I need to add something to take only the informations I want (the emails) and stock them into an array.