/* PREFIX.CMD to put a prefix on a filename. */ parse arg StripN PreF call rxFuncAdd 'sysloadfuncs','rexxutil','sysloadfuncs' call SysLoadFuncs if PreF = '' then PNum = 0 else pNum = 1 StripNum = StripN + 1 cDir = Directory() cDir = strip(cDir) say 'CDIR =' cDir if length(cDir) = 3 then chkDir = cDir || '*.*' else chkDir = cdir || '\*.*' say 'ChkDir =' chkDir fileRc = SysFileTree(chkDir, 'file.', 'FO') do i = 1 to file.0 t = length(cDir) if t = 3 then t = t - 1 t = t + 2 fName = substr(file.i, t) fName = strip(fName) tName = length(fName) - 4 if tName < StripNum then do say 'ERROR ****' fName 'is too short to strip' StripNum 'characters ****' iterate i end sName = substr(fName, StripNum) pct = ( i / file.0 ) * 100 if pNum = 0 then do say fName '==>' sname ' ==>' right(i,4) 'of' file.0 format(pct,3,2)'%' 'ren' '"' || fName || '"' '"' || sname || '"' end ELSE do say fName '==>' preF || sname ' ==>' right(i,4) 'of' file.0 format(pct,3,2)'%' 'ren' '"' || fName || '"' '"' || preF || sname || '"' end end exit