@ECHO OFF *SETLOCAL *UNALIAS * ALIAS Recycle=`%@IF[%_CMDPROC EQ 4DOS,C:\More95\Recycle -f,*DEL /R /Q]` SET theIndex=index.php ALIAS sed=C:\etc\SED :: Find the old number of scores in theIndex SET MyStr1=currently SET theLine="%@EXECSTR[FFIND /K /M /T"%MyStr1" %theIndex]" SET pos=%@EVAL[%@INDEX[%theLine,%MyStr1] + %@LEN[%MyStr1] + 1] SET oldNum=%@INSTR[%pos,3,%theLine] :: Count the new number of scores SET tempFile=%@UNIQUE[%temp\] FFIND /S /U /[!libretto.pdf intro.pdf] *.pdf > %tempFile SET newNum=%@WORD[0,%@LINE[%tempFile,%@LINES[%tempFile]]] DEL /Q %tempFile IFF %oldNum NE %newNum THEN :: Find the old modification date in theIndex SET MyStr2=Last edited: SET theLine="%@EXECSTR[FFIND /K /M /T"%MyStr2" %theIndex]" SET pos=%@EVAL[%@INDEX[%theLine,%MyStr2] + %@LEN[%MyStr2] + 1] SET oldDate=%@INSTR[%pos,17,%theLine] FUNCTION MonthName=`%@FIELD[%1,,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec]` SET newDate=%@FORMATN[02.0,%_DAY]-%@MonthName[%_MONTH]-%_YEAR %@FORMATN[02.0,%_HOUR]:%@FORMATN[02.0,%_MINUTE] ECHO Updating the number of scores from %oldNum to %newNum and ECHO the modification date from %oldDate to %newDate ::ECHO 1R%MyStr1 %[oldNum]%@CHAR[26]%MyStr1 %newNum > edlin.inp ::ECHO 1R%MyStr2 %[oldDate]%@CHAR[26]%MyStr2 %newDate >> edlin.inp ::ECHO E >> edlin.inp PAUSE ::EDLIN %theIndex < edlin.inp > NUL ::DEL /Q edlin.inp ::Recycle %@NAME[%theIndex].BAK sed -e"s/%MyStr1 %[oldNum]/%MyStr1 %newNum/" -e"s/%MyStr2 %[oldDate]/%MyStr2 %newDate/" %theIndex > %@NAME[%theIndex].new Recycle %theIndex REN /Q %@NAME[%theIndex].new %theIndex ELSE ECHO No new scores (%oldNum). Nothing to do. ENDIFF