Home
> Uncategorized > ISPF Edit ‘Count’ macro
ISPF Edit ‘Count’ macro
Just a little macro I put together to count the number of occurrences of a string in a file when editing it.
/* rexx */ ADDRESS ISREDIT "MACRO (text)" if text = '' then do say 'Nothing to search for. Enter text to search for ith cmd' return 0 end address isredit "find all "text address isredit "(num,lines) = FIND_COUNTS" num=num+0 lines=lines+0 s='' if num > 1 then s='s' ls='' if lines > 1 then ls='s' on='' if lines > 0 then on = ' on 'lines' line'ls say 'Found 'num' occurance's' of 'text||on
To run it, just type count followed by the string to search for, and any other parameters such as the column number on the command line when in edit and press enter. E.G.
COUNT ‘some string’
or
COUNT NAME 1
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback