Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.os.vms Subject: Re: Text processing on VMS Date: Mon, 14 Oct 2024 12:30:19 -0000 (UTC) Organization: A noiseless patient Spider Lines: 55 Message-ID: References: <8734l0t56u.fsf@lucy.meyer21c.net> <670c8368$0$705$14726298@news.sunsite.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 14 Oct 2024 14:30:19 +0200 (CEST) Injection-Info: dont-email.me; posting-host="25db3d423abc08c26dabb90607bfb792"; logging-data="1266657"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eHVvQe78qQU2LBXOQlMCvNt95oSiUHQY=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:+bOW0xkqeVd5YPqugwHc1ffBJqI= Bytes: 2518 On 2024-10-13, Arne Vajhøj wrote: > On 10/13/2024 3:26 PM, Arne Vajhøj wrote: >> On 10/13/2024 2:57 PM, Dave Froble wrote: >>> Using SEARCH and then a simple Basic program is not that much work. >>> >>> For example: >>> >>> SEARCH File1.txt "some text" /output=File2.txt >>> >>> 1    On Error Goto 90 >>> >>> 10    Open "file2" For Input as File 1% >>>      Open "File2" For Output as File 2% >>> >>> 20    Linput #1%, Z$ >>>      Print #2%, Mid(Z$,?,?) >>>      Goto 20 >>> >>> 90    GoTo 99 If ERR=11 >>>      On Error GoTo 0 >>> >>> 99    End >>> >>> Simple >>> No having to know whatever is your favorite utility >>> I seriously doubt there would be much fewer characters >>> >>> No, I didn't try it ... >> >> I have confidence in your VMS Basic skills. > > But I am curious about how you iterate over the file. > > Are there any benefits from this way compared to: > > handler eof_handler > end handler > when error use eof_handler > while 1 = 1 > get #1 > ! do whatever > next > end when > That's how a Pascal programmer would write it. David however clearly prefers Dartmouth Basic. :-) BTW, I think your approach is a lot more readable than David's style. :-) Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Walking destinations on a map are further away than they appear.