Changing date format of text file column
Posted: 04 Jun 2013 14:24
I have date and time in the first column of a comma delimited text file in this format:
MM/DD/YYYY H:M:S
and am trying to change it to:
YYYY/MM/DD H:M:S
I have been attempting to write a batch file for this, and have come up with this:
for /f "tokens=1-4 delims=/ " %%a in C:\Users\cs\Documents\headcur.csv do (
set "month=%%a"
set "day=%%b"
set "year=%%c"
set "mytime=%%d"
)
set "newtime=%year%/%month%/%day% %mytime%"
echo %newtime%
But nothing happens...
Could anyone point me in the right direction?
MM/DD/YYYY H:M:S
and am trying to change it to:
YYYY/MM/DD H:M:S
I have been attempting to write a batch file for this, and have come up with this:
for /f "tokens=1-4 delims=/ " %%a in C:\Users\cs\Documents\headcur.csv do (
set "month=%%a"
set "day=%%b"
set "year=%%c"
set "mytime=%%d"
)
set "newtime=%year%/%month%/%day% %mytime%"
echo %newtime%
But nothing happens...
Could anyone point me in the right direction?