Discussion Locked

Using A Batch File To Rename Text Files

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a scenario whereby an Oracle application I developed generates a text file output. This output must reside in a seprate directory on daily basis such that yesterday's output file must have a different name than today's file.
I have another program which generates a unique filename (a text string) and writes it to another text file.
My problem is how to use a redirection symbol in a DOS batch file to pick this unique filename to automatically rename my output file everyday.

1 reply

by martin.desourdis

If you look at the easy logistic ,from the oracle application I would name the file exemple: %date%+(%hours%)*+repport.txt
after that you write a batch file that you make run as a service that refresh evry hour that create a folder called %date%+(%hours%)*+repport were you copy the file to (as a backup)an send another copy > %to what ever the name you want once you did these copy you delete the original file from the upload folder... you need to make sure that your batch file is syncronise with the upload thats-it..

This discussion is closed to new replies.