home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / text / FAQ / bonus / faq_rename_byKL.rexx < prev    next >
OS/2 REXX Batch file  |  1995-09-17  |  1KB  |  44 lines

  1. /*  ARexx skript
  2.     zur Umbenennung der Fakename-FAQ mittels Keyword-Liste
  3.     $VER: faq_rename_byKL.rexx 1.0 (17.09.95) ©1995 Khamsonh Marcel Khounlivong
  4.     */
  5.  
  6. OPTIONS RESULTS
  7.  
  8. PARSE ARG keylist destination
  9.  
  10. keylist     = Strip(keylist)
  11. destination = Strip(Strip(destination),t,'/') || '/'
  12.  
  13. IF (destination == "/") THEN DO
  14.     SAY "faq_rename.rexx ©1995 Khamsonh Marcel Khounlivong"
  15.     SAY "use: [rx] faq_rename_byKL[.rexx] keylist destination"
  16.     EXIT 0
  17.     END
  18.  
  19. CALL AddLib("rexxsupport.library",5,-30)
  20.  
  21. IF (~Open(infile,keylist,r)) THEN DO
  22.     SAY ''keylist 'not exists'
  23.     EXIT 20
  24.     END
  25.  
  26. DO FOREVER
  27.     string = ReadLn(infile)
  28.     IF (string == "") THEN DO
  29.         CALL Close(infile)
  30.         EXIT
  31.         END
  32.  
  33.     arcname = Word(string,1)
  34.     faq = Word(string,Words(string))
  35.  
  36.     pos1 = Pos('/',arcname)
  37.     DO WHILE(pos1 ~= 0)
  38.         CALL MakeDir(destination || SubStr(arcname,1,pos1-1))
  39.         pos1 = Pos('/',arcname,pos1+1)
  40.         END
  41.  
  42.     ADDRESS command 'Copy' faq destination || arcname
  43.     END
  44.