1st Dan needed to delete the names. The delimiter is the first space. So delete everything from the first space to end of line:
To delete the emails, a 2nd Dan is needed. Delete any non-space and the first space from the beginning of the line:
s/^[^ ]* //
Note: This answer assumes, that the delimiter is a single space character. If the delimiter between the email and the name is a
<tab> or multiple spaces or any combination of it, we have to move to the 3rd Dan:
This deletes from the first whitespace (be it a space or a tab) till the end of line.
This deletes from the beginning of the line (
^) all non-whitespace characters (
\S*) including the following one or more whitespaces (
:help /^ and
The simplest case is if you want to act on the entire file, just use
If it is only a part of the file, the easiest way is to visually select the lines and then hit
: and enter one of the substitution commands from above.