home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1994 October / SOFM_Oct1994.bin / pc / os2 / fm2 / cvt4os2.cmd < prev    next >
OS/2 REXX Batch file  |  1994-08-07  |  1KB  |  41 lines

  1. /* Convert DESCRIPT.ION files to WPS .SUBJECT EAs    */
  2. /* I'm not terribly familiar with 4OS2 so this might */
  3. /* not cover unusual situations (for instance, I'm   */
  4. /* guessing the format is "filename.ext description" */
  5. /* and don't try to handle filenames with embedded   */
  6. /* spaces since I don't know how they're handled in  */
  7. /* the file (quote delimited?).  Modify to taste.    */
  8. /* As written, DESCRIPT.ION file must be in the      */
  9. /* default directory.                                */
  10.  
  11. '@echo off'
  12. describename = stream('DESCRIPT.ION','C','query exists')
  13. if describename \= '' then
  14. do
  15.   destream = stream(describename,'C','open')
  16.   if destream = "READY:" then
  17.   do
  18.     say 'Working...'
  19.     call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  20.     call SysLoadFuncs
  21.     do while lines(describename)
  22.       text = linein(describename)
  23.       parse var text filename text
  24.       text = left(text,40)
  25.       text = strip(text)
  26.       filename = strip(filename)
  27.       if filename \= '' then
  28.         if text \= '' then
  29.         do
  30.           description = 'FDFF'x || d2c(length(text)) || '00'x || text
  31.           call SysPutEA filename,'.SUBJECT',description
  32.         end
  33.     end
  34.     call stream describename,'C','close'
  35.     'del 'describename
  36.   end
  37. end
  38. else
  39.   say 'File DESCRIPT.ION not found in current directory.'
  40. exit
  41.