where I need to add a date stamp to a file name using a post-processing script
REPL can add text here and there easily but the solution is heavily dependent on the text that needs to be changed,
and if it is in the first column, or following some other text, and if there are other lines etc.
REPL uses regular expressions to modify text, though it can do literal text replacement too.
The date can be taken using another few lines of batch script.
You really wouldn't use REPL to rename files with a date. You can do that with plain ole batch.
Oops, I read it as text manipulation rather than renaming a file.
Adding code to get a date in a variable here:
The first four lines of this code will give you reliable YY DD MM YYYY HH Min Sec variables in XP Pro and higher.
@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%" & set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
echo datestamp: "%datestamp%"
echo timestamp: "%timestamp%"
echo fullstamp: "%fullstamp%"
pause