ZTree.com  | ZEN  | About...  

 Index   Back

[Tip] Macro: In View, extract and edit only matching lines   [Tip]

By: Slobodan Vujnovic   Homepage   France  
Date: Nov 29,2013 at 17:08

Standing on the shoulders of:
http://www.ztw3.com/forum/forum_entry.php?id=117252
I created a macro that works great as a workaround for my
long-standing wish:
http://vujnovic.free.fr/ztw/ztw_zeps.html#ZEP500

; EditMatchingLines.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. Editor : C:\1\Notepad++\notepad++.exe
; 2. Temporary file: %TEMP%\zt$$$match.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 "string" in current file
x,CTRL_BKSP,@FIND,SPACE,/I,SPACE,QUOTE,SH_INS,QUOTE,SPACE,
; Insert current filespec
TAB,SPACE,
; Capture output in %TEMP%\zt$$$match.tmp
>%TEMP%\zt$$$match.tmp,RET,
; Edit output in your editor
x,CTRL_BKSP,@start "" C:\1\Notepad++\notepad++.exe %TEMP%\zt$$$match.tmp,RET,
; We should be in the editor. ZTree remains in Viewer
ESC,STOP

1,762 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 71 users online (0 registered, 71 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 1:59 pm UTC  |  Hits:62,369,301  (21,698 Today )
RSS Feed