| View previous topic :: View next topic |
| Author |
Message |
CPC Strategy
Joined: 11 Nov 2009 Posts: 4
|
Posted: Wed Jul 13, 2011 8:20 am Post subject: renaming files with dynamic names. |
|
|
We have an export process to our folder that exports filenames with dates in this format:
file_US_en_2011-06-25_01-04-58.csv
file_US_en_2011-06-26_01-03-59.csv
file_US_en_2011-06-27_01-04-01.csv
file_US_en_2011-06-28_01-04-07.csv
file_US_en_2011-06-29_01-03-03.csv
And so forth.
What we want to do is take the latest file and rename it to something static on a daily basis, e.g. in the sample above, the file:
file_US_en_2011-06-29_01-03-03.csv
Would be renamed to
file_US.csv
And the next day a file with the name:
file_US_en_2011-07-30_02-03-03.csv
Would overwrite the previous instance of "file_US.csv"
Thanks in advance |
|
| Back to top |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Wed Jul 13, 2011 10:08 pm Post subject: |
|
|
| Is the latest filename based on todays date or any arbitrary date in the past? |
|
| Back to top |
|
 |
|