Subject: | |
From: | |
Reply To: | |
Date: | Mon, 3 Jan 2000 18:40:32 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Thus it was written in the epistle of Steve Hammond,
> Since the Robelle people are taking a well-deserved day off, I need help with QEDIT.
>
> Here's what I want to do:
> - I have file SCHEMA
> - every time a find the word "OCCURS" in the file, I want to:
> - add a line before it that says "BEGIN"
> - add a line after it that says "END"
>
> I tried a USE file that had
> t SCHEMA
> l "OCCURS"
> a *-1 = B (a file that contains a single line that says "BEGIN")
> a *+1 = E (a file that contains a single line that says "END")
>
> this USE file just added the lines to the last occurance of "OCCURS"
>
> I know I'm close, but I can't figure out how to do the repetitive function
>
> thx
> steve hammond
Steve,
Here's my shot (very nearly stolen from the qedit help on "while" :-).
Create a file called ADDEM (or whatever) that looks like this:
/s window (U)
setjcw cierror = 0
continue
/findq "OCCURS" first
while cierror = 0 do
/aq *-1=B
/aq *+1=E
continue
/findq "OCCURS"
endwhile
then open the file you want to modify and type "ADDEM"
/O MYFILE
/ADDEM
That should do it. Note that ADDEM is a command file, not a use file--while
doesn't work in use files. By the by, you'll get an "Error: End of File" when
it's done. Don't worry about it. That's normal.
HTH,
Ted
--
Ted Ashton ([log in to unmask]), Info Serv, Southern Adventist University
==========================================================
[about Fourier] It was, no doubt, partially because of his very disregard
for rigor that he was able to take conceptual steps which were inherently
impossible to men of more critical genius.
-- Langer, Rudoph E.
|
|
|