Page 1 of 1
creating file names with time and date?
Posted: Fri Aug 22, 2008 9:04 am
by edwoodza
can anyone tell me how to script it so it saves the chart with a file name like:
winds(year)(month)(day)(hour).gif
otherwise i have to create a script for each hour and tell it to save the file name.....
Posted: Sat Aug 23, 2008 9:50 am
by mbsarwin
hi,
you can use this example to try out what you want to do.
i have used it successfuly to make copy the downladed files with date and time to do the archival.
@echo off
rem rename syn.dat With Name Date and Time
for /f "tokens=2-4 delims=/- " %%a in ('date /t') do set XDate=%%a-%%b-%%c
for /f "tokens=1-2 delims=: " %%a in ('time /t') do set XTime=%%a-%%b
copy c:\digatmos\data\syn.dat c:\digatmos\data\%XDate%%XTime%_syn.dat
copy c:\digatmos\data\fsusyn.dat c:\digatmos\data\%XDate%%XTime%_fsusyn.dat
copy c:\digatmos\data\albanyboy.dat c:\digatmos\data\%XDate%%XTime%_albanyboy.dat
copy c:\digatmos\data\codupa.dat c:\digatmos\data\%XDate%%XTime%_codupa.dat
copy command copies the .dat files with date time suffix.
cheers
Bala.
Posted: Sat Aug 23, 2008 1:55 pm
by edwoodza
hi
how can i get it save the time on 24 hour format?
Posted: Sun Aug 24, 2008 9:06 pm
by Wood Ant
Sorry,
But I can not get this batch file to work.
Create file names with date and time
Posted: Thu Aug 28, 2008 8:30 pm
by ianp
I use a script for each hour I want a plot
with the following:
# write map to gif file
EXPORT,F:\program files\DigAtmEquinox\archive\@FFZ@MMZ@DDZ12.gif
you could add any name along with the @FFZ etc. I've just added 12 for 12:00 in this example