Help needed - editing email id's to make them web addresses



  • I have a list of email addresses - I want to take this list and replace the user’s name and the @ sign and replace it with “www.” CAn I do this ?



  • Yes you can, I use macros for similar tasks. For example, this should work -

    1. open the file with the email addresses in it.
    2. position the text cursor at the beginning of the first line in the file
    3. ctrl-F(find), place the @ sign in the “Find What” box.
    4. click “Find Next”
    5. close the search dialog box
    6. reposition the text cursor at the beginning of the first line in the file
    7. start a macro recording, either with the “Macro” menu or the record icon on the toolbar
      start of macro here
    8. tap the home key
    9. hit the F3 key, the cursor moves to the first @ sign
    10. hit the right-arrow key, the cursor is now positioned to the right of the @ sign
    11. hold down the shift-key and tap the home key, the cursor moves to the beginning of the line and highlights the text you’ll replace
    12. type your replacement text - www.
    13. tap the home key
    14. tap the down-arrow
      end of macro here
    15. stop the macro recording either with the “Macro” menu or the stop icon on the toolbar

    Now you’re ready! You can replay the macro for each line using ctrl-shift-p or use the play icon in the toolbar. Or if the file is quite large you can have the macro reply until the end of the file. That’s done with “Macro”->“Run a Macro Multiple Times” or by using the fast-forward icon in the toolbar. When the dialogbox shows up you can select “Run until the end of file”.

    If you’re going to need to run that macro on more than one file you can save the current recorded macro either from the “Macro” menu or from the toolbar. It will allow you to name it and assigne a key press to it.



  • @jxmot

    A problem with this approach is that the F3 Find Next isn’t quite equivalent to pressing the Find Next button in the Find window, at least for the purpose of macro recording discussed here. An F3 recorded in a macro will perform a find-next action, but it will be on whatever text the find feature was most-recently used with, which is not always going to be an @ symbol (unless all a user ever searches for is @!).

    Why not simply record this as a Replacement action?, e.g.:

    Invoke Replace window (ctrl+h)
    Find what zone: (?-s)^.+?@
    Replace with zone: www.
    Search mode: Regular expression
    direction and wrap settings: as desired
    Action: Replace (or Replace All if desired)



  • Thank you - both methods worked fine ! The second one by Scott is much faster.
    I appreciate the help.
    Best regards,
    Kerry


Log in to reply