3 replies
Hi,
If you're doing this in a batch file (rather than something more powerful like Perl) then you'll likely be using things like...
date /t > somefile.txt
and then...
E:\Documents and Settings\Tim Medhurst>date /t > temp.txt
E:\Documents and Settings\Tim Medhurst>type temp.txt
Tue 11/06/2002
E:\Documents and Settings\Tim Medhurst>for /f "tokens=1,2,3,4 delims=/ " %i in (
temp.txt) do echo %i %j %k %l
E:\Documents and Settings\Tim Medhurst>echo Tue 11 06 2002
Tue 11 06 2002
The for statement will read that file and tokenise the components of the date. You'll do the calculations based on the results of that.
do a for /?
for more information on how the for statement operates. Its quite powerful.
Cheers,
Tim.
by ehendric
by ehendric
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending