home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / c / crashmailv1.22reg.lha / CrashMail / rexx / R20EchoConv.rexx < prev    next >
OS/2 REXX Batch file  |  1995-06-03  |  1KB  |  54 lines

  1. /* $VER: R02EchoConv 1.0 (03.06.95)
  2.  
  3.    by Johan Billing
  4.  
  5.    This ARexx script is probably only of interest to Swedish users. The script
  6.    converts the R20_ECHO.LST file to a format that can be used for AreaFix
  7.    forward-requests and auto-adding of descriptions. It is a good idea to
  8.    convert the file from PC8 to Latin-1 using a program such as CharConv
  9.    before running this script.
  10.  
  11.    Syntax: rx R20EchoConv.rexx <R20_ECHO.LST> <output file>
  12.  
  13. */
  14.  
  15. parse arg echoname" "outname
  16.  
  17. IF ~SHOW(Libraries,'rexxsupport.library') THEN
  18.     IF ~ADDLIB("rexxsupport.library",0,-30,0) THEN EXIT
  19.  
  20. call open('echofile',echoname,'R')
  21. call open('outfile',outname,'W')
  22.  
  23. tagname=""
  24. desc=""
  25.  
  26. do while ~eof('echofile')
  27.  inline=readln('echofile')
  28.  inline=strip(inline,'T','0d'x)
  29.  
  30.  if pos(' : ',inline)~=0 then do
  31.   parse var inline field ':' contents
  32.   field=strip(field,'B')
  33.   contents=strip(contents,'B')
  34.  
  35.   if field="NAMN" then do
  36.    if tagname~="" then do
  37.     tagname=overlay(tagname,"",1,max(30,length(tagname)))
  38.     call writeln('outfile',tagname desc)
  39.    end
  40.    tagname=contents
  41.   end
  42.   if field="TITEL" then desc=contents
  43.  end
  44. end
  45.  
  46. if tagname~="" then do
  47.  tagname=overlay(tagname,"",1,max(30,length(tagname)))
  48.  call writeln('outfile',tagname desc)
  49. end
  50.  
  51. call close('echofile')
  52. call close('outfile')
  53.  
  54.