@EI// -1EU ! VAX/VMS Version of SCAN.TEC. To use, create the file DIR.GET as a DIR output of the files you wish to process, create the file DO.GET as the TECO macro to be invoked against each file in DIR.GET, and then invoke the SCAN.TEC macro. DIR/OUT=DIR.GET MUNG SCAN Note that we use the DIR.GET file because not all of the TECO implementations do the necessary wildcard processing. ! @ER/DIR.GET/ ! Process the directory file (DIR.GET). Headers and footers are stripped, the directory path placed in front of each file, each file placed on a separate line, version numbers removed, resulting duplicate filenames and any DIR.GET and DO.GET entries removed, and and blank lines, spaces and tabs deleted. The result is placed into the text portion of Q-reg 6, with the number of files to process in the numeric portion of Q-reg 6. ! Y JK @S/Directory^ES/ .U5 @S/]/ Q5,.X5 J2K ZJ-2K J <@S/;/; @FR// \^[ @FR/ / > J <@S/^ES/; @FR//> J<@S/ / ;@FR/ / -L > J 0U6 < .-Z"E0;' <::@S/DO.GET/"T0LK|::@S/DIR.GET/"T0LK|0;''> XAL <::@S/^EQA/"T-K|0;'> %6^[ > HX6 HK ! Obtain the execution macro ! @ER/DO.GET/ Y HX1 HK ! Invoke the DO.GET macro for each of the DIR.GET files. Upon each entry to the macro, Q-reg 1 contains the macro being invoked, Q-reg 2 has the name of the file being processed, the file has been opened in Edit-Read mode, and the first page is in memory. Note that, after exit from the macro, an HKEK will be executed, thereby throwing away any remainder of the file. Thus, if the file is being reprocessed in any way (eg., reopened as Edit-Backup), the macro will have to do an EC before returning. For example, the following DO.GET macro would change all occurrences of "ABC" to "Hello There" and list them on the screen: @:_/ABC/"T HK @EB/^EQ2/ Y <@N/ABC/;@FR/Hello There/V> EC' The macro is invoked the number of times specified in Q-reg 6. At the beginning of each loop, the next filename to process is removed from Q-reg 6, a message of the form "" emitted (where N is the current file number and M is the total files files being processed), the file opened in Edit-Read mode, the macro invoked, and an HKEK performed. ! 0U2 Q6< HK G6 JG5 L-2D 0X20K HX6 HK @^A/ / :G2 @^A/ / :@ER/^EQ2/"F @^A/ *** Could not locate file *** / 7^T @O/SKP/' Y M1 !SKP! HKEK > EX