Hide non-bookmarked lines

Help with writing and playing macros

Hide non-bookmarked lines

Postby rmfought » Mon Aug 27, 2007 1:40 pm

Hi, I'm using UltraEdit to review log files, and I have bookmarked lines of interest. Now I wish to hide all lines that are NOT bookmarked. Is there an easy way to do this?
User avatar
rmfought
Newbie
 
Posts: 1
Joined: Wed Mar 21, 2007 11:00 pm

Re: Hide non-bookmarked lines

Postby Mofi » Tue Aug 28, 2007 1:42 pm

As workaround you could use the macro I posted at Copy to clipboard bookmarked lines? to copy all bookmarked lines to a new file. Append the commands

NewFile
Paste

to the macro and you have a quick solution. I will try to write a macro which uses command HideOrShowLines to hide (most) lines not bookmarked.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4054
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Hide non-bookmarked lines

Postby Mofi » Tue Aug 28, 2007 2:42 pm

Here is the macro to hide (most of) all lines not bookmarked. I hope, I got all special cases and it works for all settings and versions. The macro is for UE v12.20 and UES v6.10 or any later. For previous versions delete the red marked bookmark numbers -1 and it should work too.

InsertMode
ColumnModeOff
HexOff
Bottom
IfColNum 1
Else
"
"
EndIf
Key UP ARROW
GotoBookMark -1
IfEof
ToggleBookmark
Else
Bottom
EndIf
PreviousBookmark
IfEof
Top
ExitMacro
EndIf
Top
GotoBookMark -1
Key HOME
IfColNumGt 1
Key HOME
EndIf
"ÿ"
Bottom
Loop
StartSelect
PreviousBookmarkSelect
Key HOME
IfColNumGt 1
Key HOME
EndIf
Key DOWN ARROW
IfSel
Key UP ARROW
HideOrShowLines
Else
Key UP ARROW
EndIf
EndSelect
IfSel
Key HOME
IfColNumGt 1
Key HOME
EndIf
EndIf
IfCharIs "ÿ"
Delete
ExitLoop
EndIf
EndLoop
SelectToTop
IfSel
HideOrShowLines
EndIf
EndSelect
Top
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4054
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros