home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / tools / a-kwic / examples / aminet-readme.rexx next >
OS/2 REXX Batch file  |  1994-02-07  |  3KB  |  104 lines

  1. /* aminet.rexx - Generate an inputfile for loaddb from "Aminet" "Readme" file 
  2.  *
  3.  * $Id: aminet-readme.rexx 1.1 1994/02/08 13:32:12 D_Lowrey Exp $
  4.  *
  5.  *         syntax: cd AMINET_0692:AMINET
  6.  *                 rx aminet-readme.rexx tempfile outfile
  7.  *
  8.  *         Where:  tmpfile = A temporary file that will contain all of the
  9.  *                 '.README' file names.
  10.  *
  11.  *                 outfile = The file to contain the output
  12.  *
  13.  *  This script took about 45 min. to run on my A2500 with a VERY slow
  14.  *  NEC CDR-25 CD-ROM drive.
  15.  *
  16.  *  The database load from the output of this command took about an hour.
  17.  *
  18.  *  NOTE: The README files for several of the programs are very long, and
  19.  *        cause LoadDB to hit maximum keywords for those records.
  20.  *        To fix this, you can either raise MAXKW to a very large number,
  21.  *        or edit the output file from this script to reduce the number of
  22.  *        lines in each of the offending records.
  23.  *
  24.  *        In most cases, the records are long because the README file contains
  25.  *        an entire user manual for the product, so editing the file to
  26.  *        remove excess text is appropriate.
  27.  *
  28.  *        You can also leave the input as-is. In this case, some keywords
  29.  *        may not match the long records.
  30.  *
  31.  *        These are the offending records for the 06/93 Aminet CD-ROM:
  32.  *
  33.  *        BIZ/DEMO/TSDEMO
  34.  *        DEV/C/CURSES_2_00
  35.  *        DEV/DEBUG/PV142
  36.  *        GAME/MISC/MINESWEEPER
  37.  *        GAME/THINK/AMIGAGNUCHESS
  38.  *        GAME/THINK/MADGIC41
  39.  *        GAME/THINK/UCHESS
  40.  *        GAME/THINK/UCHESS226
  41.  *        GAME/THINK/UCHESSPATCH
  42.  *        GAME/THINK/WBGAMES7
  43.  *        GFX/SHOW/MP01
  44.  *        MISC/EMU/QDOS4AMIGA
  45.  *        MUS/EDIT/AMISOX_WAV
  46.  *        OS20/CLI/LS_4_7LJR
  47.  *        PIX/ILLU/EMPLANTPICS
  48.  *        TEXT/SHOW/PPMORE20
  49.  */
  50.  
  51. parse arg listfile outfile
  52.  
  53. say "Getting file names..."
  54. address command "list pat #?.README quick files all lformat=%s%s to="listfile
  55.  
  56. if ~open('List', strip(listfile), "Read") then do
  57.     say "Cant open listing file==>'"listfile"'"
  58.     exit 20
  59. end
  60.  
  61. if ~open('Output', strip(outfile), "Write") then do
  62.     say "Cant open output file==>'"outfile"'"
  63.     exit 20
  64. end
  65.  
  66. infile = strip(readln('List'))
  67. do while ~eof('List')
  68.  
  69.     infile = strip(infile)
  70.     if ~open('Input', infile, "Read") then do
  71.         say "Cant open input file==>'"infile"'"
  72.         exit 20
  73.     end
  74.  
  75.     say infile
  76.     
  77.     filename = substr(infile,1,index(infile,".README")-1)
  78.     temp = filename
  79.     nodeline = "#K"
  80.  
  81.     do while index(temp,"/") ~= 0
  82.         parse var temp node '/' temp
  83.         nodeline = nodeline' 'strip(node)
  84.     end
  85.     call writeln('Output',"#R")
  86.     call writeln('Output',"#H"filename)
  87.     call writeln('Output',nodeline' 'temp)
  88.  
  89.     line = readln('Input')
  90.     do while ~eof('Input')
  91.         call writeln('Output',line)
  92.         line = readln('Input')
  93.     end
  94.  
  95.     call close('Input')
  96.     
  97.     infile = strip(readln('List'))
  98. end
  99.  
  100. call close('Output')
  101.  
  102. exit
  103.  
  104.