ZTree.com  | ZEN  | About...  

 Index   Back

[Tip] Macro: In View, reduce the view to only NON-matching lines   [Tip]

By: Slobodan Vujnovic   Homepage   France  
Date: Nov 29,2013 at 17:33
In Response to: [Tip] Macro: In View, extract and edit only matching lines (Slobodan Vujnovic)

In this variation, we remain in the Viewer, rather than call
an editor.

; ViewNonMatchingLines.ztm - Called from Viewer with F12
; where a search string and some hits already exist.
; This is a workaround for ZEP:
; http://vujnovic.free.fr/ztw/ztw_zeps.html#ZEP500
; Customizations for your environment:
; 1. Temporary file: %TEMP%\zt$$$nonmatch.tmp
;
; Don't allow this macro to execute from DW
STOP_IF_DW,
; Don't allow this macro to execute from FW -- this
; does not work because Viewer thinks it is in FW
; STOP_IF_FW,
;
; ZEP:
; * We need STOP_IF_NOT_VIEWER to allow certain
; * macros to execute only in Viewer
;
; Grab last search "string" from history
f,UP,RET,HOME,SH_END,CTRL_INS,ESC,
; In eXecute window, FIND /V "string" (exclude) in current file
x,CTRL_BKSP,@FIND,SPACE,/I,SPACE,/V,SPACE,QUOTE,SH_INS,QUOTE,SPACE,
; Insert current filespec
TAB,SPACE,
; Capture output in %TEMP%\zt$$$nonmatch.tmp
>%TEMP%\zt$$$nonmatch.tmp,RET,
; View output in Viewer. First go to DW
ESC,ESC,
v,%TEMP%\zt$$$nonmatch.tmp,RET,
; We should be in the Viewer looking at a smaller file
; that consists of only the non-matching lines
STOP

1,122 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 63 users online (0 registered, 63 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 1:34 am UTC  |  Hits:62,387,527  (2,313 Today )
RSS Feed