Quick Email Address Validation

Help with writing and playing macros

Quick Email Address Validation

Postby Edward » Tue Aug 07, 2007 10:06 pm

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
User avatar
Edward
Newbie
 
Posts: 1
Joined: Mon Aug 06, 2007 11:00 pm

Re: Quick Email Address Validation

Postby mrainey56 » Tue Aug 07, 2007 11:26 pm

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.
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Quick Email Address Validation

Postby Mofi » Wed Aug 08, 2007 6:40 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros