I have files with ID, modeland date. files have a format similar to 10000_9999-99_10-01-2011.zip(where 10000is ID, 9999-99is model, and, of course, 10-01-2011is date).
I would like to modify datethese files, but keep the interval between sessions with the same ID. For example, if 2 sessions had dates 1/1/2011and 2/1/2011, and I wanted to update the last date of the session to 8/1/2012, the first session would have a date 7/1/2012.
Currently my code is as follows:
@echo off
setlocal enabledelayedexpansion
del filedates.txt
FOR /F "tokens=1,2,3,4,5 delims=_" %%a in (filenames.txt) do @echo %%c >>filedates.txt
FOR /F "tokens=1,2,3 delims=-" %%a in (filedates.txt) do (
echo %%a%%b
)
The result is similar to this (YearMonth):
201107
201109
201204
etc..
filedates.txt, , . , , , , .