hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

renaming files with dynamic names.

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions
View previous topic :: View next topic  
Author Message
CPC Strategy



Joined: 11 Nov 2009
Posts: 4

PostPosted: Wed Jul 13, 2011 8:20 am    Post subject: renaming files with dynamic names. Reply with quote

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
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Wed Jul 13, 2011 10:08 pm    Post subject: Reply with quote

Is the latest filename based on todays date or any arbitrary date in the past?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group