i have created a script and wanna it to loop through all the file in a directory.. but i failed to do that.. i create another script to apply the script (change_content).. here the code,
cd \input
for %%f in (*.txt) do (
echo "%%~nf"
"D:\deployment code\change_content" .\"%%~nf".txt
)
change_content.bat
call :yesterday today -1
for /f "delims=" %%a in (%1) do (
set "val=%%a"
if "!val:~12,10!"=="0001-01-01" (
>> D:\temp\%1_changed.txt echo !val:~0,12!%day%!val:~22!
) else (
>> D:\temp\%1_changed.txtecho %%a
)
)
My problem is i cant let the script to read the input file if i put it as variable. I can only put the actual file which not helpful in automate the process? this is just part of the code where i point to the input and output direction.. just wondering what should i do at the for /f place..
Would be appreciate if anyone could help on this..thanks :)