Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have an application that outputs a file consisting of a list of files specs. For example:
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_19_1_021.REPORT;2
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_20_1_083.REPORT;2
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_25_1_024.REPORT;2
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_26_1_045.REPORT;1
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_26_1_046.REPORT;1
DISK$TEST1:[INTH_TESTS.PAM.682.REPORTS.V12.SIGTRAN]PAM_27_1_015.REPORT;1I frequently have a need to convert this file into a DCL script of the form:
$@pam PAM_19_1_021
$@pam PAM_20_1_083
$@pam PAM_25_1_024
$@pam PAM_26_1_045
$@pam PAM_26_1_046
$@pam PAM_27_1_015At the moment, I do this by opening the file in EVE and executing multiple REPLACE commands. This can be time consuming if the list is several hundred lines long and the number at the end of each line can take many different values. Is there a way to automate this conversion?

Several possibilities:
(1) modify the application so that it outputs the second list together with the first.(2) modify pam.com so that it accepts the full file specifications; then in eve it is an replace ALL of string "DISK$TEST1:" by " $@pam DISK$TEST1:"
(3) write a DCL command file which loops over the file list:
$open/read in listfile.lis
$open/write out scriptfile.com
$loop:
$read/end=done in file
$name=f$parse(file,,,"NAME","SYNTAX_ONLY")
$ write out "$@pam ",name
$ goto loop
$done:
$ close out
$ close in
$ exitJoseph Huber, http://www.huber-joseph.de
ITRC

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |