Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

here it is

ab12@zmial.com, Charles Dawson cd21@zmial.com, ef23@zmial.com, gh32@zmial.com,
ij34@zmial.com, mn45@zmial.com, op54@zmial.com, Queen Roffman qr56@zmial.com,
kl43@zmial.com, st65@zmial.com, za87@zmial.com, uv67@zmial.com, mn45@zmial.com,
Wanda Ximenes wx76@zmial.com, yz78@zmial.com,  

I want to remove the strings before the 'emails' therefore only remains the 'emails at example dot example' seperated by comma.

Also, I want to search for any repeated or duplicated terms or words in all text. What command for that purpose would reply me 'mn45@zmial.com' ?

share|improve this question
up vote 0 down vote accepted

For the first part (I don't know how to report duplicates), assuming

  • The document contains only the block you gave.
  • The character "~" does not appear in the string (substitute a different unique character if it does).

    1. Select all the text with Edit > Select All (Ctrl+A).
    2. Join the lines into one with Edit > Line Operations > Join Lines (Ctrl+J).
    3. Mark emails by replacing regular expression ([^@\s]+@[^.\s]+\.[^,]+) with ~\1,\n.
    4. Delete strings before emails by replacing regular expression .*~ with a null string.
    5. If it is no longer selected, select all the text with Edit > Select All (Ctrl+A).
    6. Join the lines into one with Edit > Line Operations > Join Lines (Ctrl+J).
    7. Manually remove any excess commas at the end.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .