home *** CD-ROM | disk | FTP | other *** search
- /* Name: FORUMS.CMD */
- /* Purpose: Remove all records from FORUMS.LST file that do not */
- /* have the word "FORUM" in them. */
- /* Author: Joseph R. Franchina 74674.2144@compuserve.com */
-
- /* Description: This procudure will take the GCP FORUMS.LST file and */
- /* remove all entries that do not contain the word "FORUM" */
- /* The result file is called CLEAN.LST. Copy this file */
- /* to FORUMS.LST. This procedure does not do this so as to */
- /* allow you to backup the complete list for future */
- /* reference. This might also be insurance against any */
- /* error I might have made, I'm no REXX genius :) */
-
- /* DISCLAIMER: I have tested this procedure and have found no problems.*/
- /* With that said proceed at your own risk. */
-
- /* NOTE: Change the following to reflect your drive and directory*/
- /* for GCP. */
- filein = 'c:\gcp\forums.lst'
- fileout = 'c:\gcp\clean.lst'
-
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call SysLoadFuncs
-
- kept = 0
- discarded = 0
-
- call SysFileDelete fileout
-
- if stream(filein,'c','open read') <> 'READY:' then
- do
- say "Cannot open" filein "for read."
- exit
- end /* do */
-
- if stream(fileout,'c','open write') <> 'READY:' then
- do
- say "Cannot open" fileout "for write."
- exit
- end /* do */
-
- do until stream(filein) <> 'READY'
- source_line = linein(filein)
- parse upper var source_line upper_source_line
-
- if wordpos('FORUM',upper_source_line) > 0
- then
- do
- call lineout fileout, source_line
- kept = kept + 1
- end /* do */
- else discarded = discarded + 1
-
- end /* do */
-
- say kept 'lines written'
- say discarded 'lines discarded'
-
- call stream filein 'c', 'close'
- call stream fileout 'c', 'close'
-
- exit
-