I have a bunch of text files with different formats that somewhere in the file have email addresses. I would like to be able to parse through any number of these files for email addresses. Here are the types of input:
CFO: some_cfo@domain.com
The Main Man mainman@domain.com
To take care of the situations I have the following seds:
#Removes line with an opening title
sed -e 's/^.*://'
#Removes opening and closing whitepsace
sed -e 's/^[ ^t]*//;s/[ ^t]*$//'
Those are both really simple, but for the life of me I can't figure out how to remove normal text from before the email address. I either end up clobbering the whole thing, or including it.
I just need to end up with something like keep what is directly attached to the '@' and delete anything after or before other whitespace
The Main Man mainman@domain.com
^not part of email. ^ and ^ are both parts of email.
Any clues anyone?