General discussion

Locked

file name generation

By jadams ·
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?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

file name generation

by pVp In reply to file name generation

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.

Collapse -

file name generation

by jadams In reply to file name generation

The question was auto-closed by TechRepublic

Collapse -

file name generation

by babybax101 In reply to file name generation

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.

Collapse -

file name generation

by jadams In reply to file name generation

The question was auto-closed by TechRepublic

Collapse -

file name generation

by jadams In reply to file name generation

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums