Article View: news.software.readers
Article #1421VNEWS XX.NEWSRC Utility Program
From: THEODORE FABIAN
Date: Mon, 06 Apr 1992 01:06
Date: Mon, 06 Apr 1992 01:06
106 lines
4914 bytes
4914 bytes
I've written a utility program to sort the XX.NEWSRC files used by VNEWS.
The utility puts the newsgroups listed in the file in alphabetic order.
You can customize the code to your liking by making a few minor changes.
Read the comments in the code to see where and what to change. Have fun!
This code is simple DCL that runs under VMS on VAX systems. I offer it into
the "public domain" without any conditions, and I take no responsiblities for
any errors, omissions, or problems that result by running the code.
Ted
--BEGIN CUT HERE-------------------------------------------------------
$!
$! Written by Ted Fabian 4/5/92 at NASA Lewis Research Center
$! Cleveland, Ohio 44135
$!
$! Copyright Ted Fabian 4/5/92
$!
$! Purpose: Simple DCL file to sort XX.NEWSRC files used for VNEWS
$! news reader on a VAX
$!
$! No guarantees, warrenties, or liabilities assumed. Use this utility
$! code at your own risk!
$!
$ set noverify
$FILE_LOOP:
$!
$! This sorts the original XX.NEWSRC file, then opens a couple of temporary
$! files for use in sorting/arranging the final version of the file
$!
$ write sys$output " "
$ write sys$output "Your XX.NEWSRC file will be sorted using the criteria"
$ write sys$output "you coded into this program using your favorite editor."
$ write sys$output " "
$ write sys$output "Continue at your OWN RISK!"
$ write sys$output " "
$ inquire response "Hit Q to Abort, any other key to continue"
$ if response .eqs. "Q" then goto done
$ write sys$output " "
$ sort xx.newsrc temp.newsrc /key=(position:1,size:40)
$ write sys$output "Processing XX.NEWSRC"
$ open/read infile temp.newsrc
$ open/write outfile sorted.xxnewsrc
$READ_LOOP:
$!
$! Use this loop to pick out the news groups you want to move to the top
$! of your XX.NEWSRC file. In this example, two entire hierarchies are
$! moved to the beginning.. Add as many or as few lines as you desire
$! following the READ statement to move groups to the front of your file.
$! the group name should be in " marks, and the number of characters in
$! the group title should be the second parameter in the f$extract ()s
$!
$ read/end=loop_three infile inrec
$ if f$extract(0,3,inrec) .eqs. "cle" then goto loop_two
$ if f$extract(0,4,inrec) .eqs. "lerc" then goto loop_two
$ goto read_loop
$LOOP_TWO:
$!
$! This writes the newsgroup name to the temporary file, then loops back.
$!
$ write outfile inrec
$ goto read_loop
$LOOP_THREE:
$! After the first loop through the sorted XX.NEWSRC file, this section of
$! code closes the file, then reopens it for the second run through.
$!
$ close infile
$ open/read infile temp.newsrc
$BEGIN_LOOP:
$!
$! Now we're into code to put the rest of the groups into the XX.NEWSRC
$! file. The same logic is employed here. Add a line for each newsgroup
$! or hierarchy you want to skip. In this example, the same two hierarchies
$! that were singled out before are skipped. Same format for coding the lines.
$!
$ read/end=eof infile inrec
$ if f$extract(0,3,inrec) .eqs. "cle" then goto begin_loop
$ if f$extract(0,4,inrec) .eqs. "lerc" then goto begin_loop
$ write outfile inrec
$ goto begin_loop
$EOF:
$!
$! Close all the files, and clean stuff up. Rename the newly created
$! file to be the XX.NEWSRC file.
$!
$ close infile
$ close outfile
$ rename sorted.xxnewsrc xx.newsrc
$ delete temp.newsrc;*
$ write sys$output "XX.NEWSRC Cleaned Up"
$DONE:
$ write sys$output ""
$ write sys$output "Finished......"
$ exit
--END CUT HERE---------------------------------------------------------
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thanks,
Ted Fabian NASA Lewis Research Center
Cleveland, Ohio 44135
tpf4434@tm0006.lerc.nasa.gov
/pn=theodore.fabian/admd=telemail/prmd=lerc/c=us/@x400.msfc.nasa.gov
Disclaimer: My Opinions are My Own, not NASA's.....
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Technical Details
Message-ID:
<5APR199220062550@tm0006.lerc.nasa.gov>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!eagle!tm0006.lerc.nasa.gov!tpf4434Show Full Headers
Complete Article Headers
Message-ID: <5APR199220062550@tm0006.lerc.nasa.gov> Subject: VNEWS XX.NEWSRC Utility Program Date: Mon, 06 Apr 1992 01:06:00 +0000 From: tpf4434@tm0006.lerc.nasa.gov (THEODORE FABIAN) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!eagle!tm0006.lerc.nasa.gov!tpf4434 Newsgroups: news.software.readers Article-I.D.: tm0006.5APR199220062550 Sender: news@eagle.lerc.nasa.gov Reply-To: /PN=Theodore.Fabian/C=US/ADMD=TELEMAIL/PRMD=LERC/@x400.msfc.nasa.gov Organization: NASA Lewis Research Center / Cleveland, Ohio Lines: 106 News-Software: VAX/VMS VNEWS 1.41