Discussion Locked

file name generation

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have created a batch file to do a file transfer and transformation from ASCII to Excel and would like to give each file a unique name. When I set the file name, what can I use to add the system date to the end of the file name? Currently the file name looks like tpo.xls and I would like to have it be tpoddmm.xls. Does anyone have any ideas?

5 replies

by pvp

The details are too long to fit here!

Go to JSI Inc (www.jsiinc.com), click on NT Reg Hacks, type "date math" in the search box and go for it. Jerry has several date and time batch files for getting dates and times, breaking them into components(mm, dd, yy, etc.) and doing math on them.

by babybax101

Will check if you script is in dos. In UNIX I use 2 commands: set TDATE = `date '+%c' |awk '{print $5}'``date '+%m%d'`
cp file1.txt /path1/"file1"$TDATE".txt
copying the original to the new filename with date concatenated.

This discussion is closed to new replies.