I have a list of email, for example
johnsmith at gmail dot com
username at gmail.com
random atsign outlook dot com
The username and the provider is always separated by a custom word between spaces. The problem here is that the domain can have a custom separator like this (dot, or any text) OR just a dot, like gmail.com If it would have only spaces, I would simply read the lines and split them at the spaces, then write the first, @, the third, . and then the fifth items from the list. However, the possible john at gmail.com format is problematic for me. How could I handle this format along with the simple name at gmail dot com formats in one script?