HTML Tag Strip Utility

This REXX utility will strip all the HTML tags out of the first file specified and save the text in the second file specified. Save the text between the horizontal rules (<PRE> tags if you are looking at the raw file) as HTMLSTRP.CMD and proceed from there. It's all pretty self explanatory. This utility is provided for use at your own risk. All the usual disclaimers apply.

/*   HTML Tag Strip Utility  */

/* call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'*/

ARG FileSpec NewFileSpec

IF FileSpec = "" | NewFileSpec = "" THEN 
    SAY "Usage: HTMLSTRP file newfile"

Result = STREAM(FileSpec,'C','OPEN READ')
SAY "Opening "FileSpec" returned a status report of "Result
Result = STREAM(NewFileSpec,'C','OPEN WRITE')
SAY "Opening "NewFileSpec" returned a status report of "Result
SAY "Now processing. This may take a while."
DO WHILE LINES(FileSpec) > 0
  WorkChar = CHARIN(FileSpec)
  IF WorkChar = "<" THEN
    DO UNTIL WorkChar = ">"
      WorkChar = CHARIN(FileSpec)
  ELSE Result = CHAROUT(NewFileSpec,WorkChar)
Result = STREAM(FileSpec,'C','CLOSE')
SAY "Closing "FileSpec" returned a status report of "Result
Result = STREAM(NewFileSpec,'C','CLOSE')
SAY "Closing "NewFileSpec" returned a status report of "Result

[ OS/2 Link Page | Mail Webmaster | About Webmaster ]