Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JohnDohe

macrumors member
Original poster
Hi,


I've got a long list of 100's of emails formatted like this:
John, Doe.jdoe43@gmail.com,


But the "John, Doe." preceeding the actual email
address is being read as an incomplete email
address when I use this list to Bcc my friends
so I'm happy to just delete "John, Doe." and be
left with just the email addresses in my list.

I want to end up with just this:
jdoe43@gmail.com,

I need to delete the,
* first name,
* the comma "," after the first name,
* the last name,
* the period '.' after the last name
to be left with just the email address.

I've tried to figure out how to use "Word for Mac 2019's"
wildcards to search and replace, but I cannot figure out
how to properly format the search term in the "Find what"
field of the "Advanced Find and Replace" function.

Does anyone know the proper way to do this so I can
run the "Find and Replace" to remove all but the
email address in my list of hundred's of names+emails?

Thanks!
 
Assuming the names do not have dots in them, you can try this:
1. put the list in a plain text file (TextEdit, make a new document, select the Plain text format https://support.apple.com/guide/textedit/change-textedit-preferences-txted1063/1.17/mac/12.0)
2. open Terminal (/Applications/Utilities/Terminal.app) and copy-paste

Code:
sed -i '' 's/^[^.]*.//g'

3. press space, drag&drop the text file and press enter.

The command should delete all the characters up to and including the first dot on every line, leaving only the e-mail addresses in the text file. Each combination of name and address should be on a line for this to work.
So,
John, Doe.jdoe43@gmail.com,
John, Doe.jdoe43@gmail.com,
not
John, Doe.jdoe43@gmail.com, John, Doe.jdoe43@gmail.com,
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.