/* PAD.REX to put a pad filename with 0. */ parse arg pPad pChar if pChar = '' then pChar = 0 call rxFuncAdd 'sysloadfuncs','rexxutil','sysloadfuncs' call SysLoadFuncs Say 'Starting . . .' cDir = Directory() cDir = strip(cDir) say 'CDIR =' cDir if length(cDir) = 3 then chkDir = cDir || '*.*' else chkDir = cdir || '\*.*' say 'ChkDir =' chkDir rc = sysfiletree(chkDir, 'FILE', 'FO') say 'File.0 =' file.0 do i = 1 to file.0 t = length(cDir) if t = 3 then t = t - 1 t = t + 2 fName = substr(file.i, t) parse value fname with fn1 '.' fext say 'fn1 =' fn1 'and fname =' fname if length(fn1) < pPad then dPad = pPad - length(fn1) else iterate i pFix = copies(pChar, dPad) pct = ( i / file.0 ) * 100 say fName '==>' pFix || fname '==>' right(i,4) 'of' file.0 format(pct,3,2)'%' 'ren' fName pFix || fname end exit