Quick Email Address Validation

Quick Email Address Validation

1
NewbieNewbie
1

    Aug 08, 2007#1

    I am using UE to check that each email address at least has '@' sign. I do this in a quick-macro by searching for a '@' symbol, copying the line to the bottom of the file, and then going back to the top of the file. I then call the macro again with the short cut key.

    Takes quite a long time because (1) the screen refreshes (and I don't need this) and (2) I have to call the macro a lot--thousands of lines to check.

    Is there an easier way to do this?

    Thanks,

    Edward

    206
    MasterMaster
    206

      Aug 08, 2007#2

      Something to try (untested).

      Search for all lines containing "@" - use the List Lines Containing String option and copy the found lines to the clipboard

      Search the file again for all lines containing an "@", including the beginning of the line and the CR/LF - replace with nothing (i.e., delete the lines). Uncheck the List Lines Containing String option before doing this search.

      Paste the contents of the clipboard into your file. The lines that contain "@" should be separated from the ones that don't.
      Software For Metalworking
      http://closetolerancesoftware.com

      6,686585
      Grand MasterGrand Master
      6,686585

        Aug 08, 2007#3

        Here is the macro solution for the process described by mrainey56.

        The macro works only for DOS terminated files because of ^p in the search string.

        Note: I have not tested the macro. I have written it directly in the edit field in the browser window.

        The macro property Continue if a Find with Replace not found must be checked for this macro.

        InsertMode
        ColumnModeOff
        HexOff
        UnixReOff
        Bottom
        IfColNum 1
        Else
        "
        "
        EndIf
        Top
        Clipboard 9
        ClearClipboard
        Loop
        Find RegExp "%*@*^p"
        IfFound
        CutAppend
        Else
        ExitLoop
        EndIf
        EndLoop
        Top
        IfEof
        "No line without @ found !!!
        "
        Else
        "Following lines do not contain @:
        "
        Bottom
        "------------------------------------
        "
        EndIf
        Paste
        Top
        ClearClipboard
        Clipboard 0

        Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.
        Best regards from an UC/UE/UES for Windows user from Austria