Connecting Tech Pros Worldwide Help | Site Map

Filename Increments

  #1  
Old July 8th, 2009, 04:24 PM
benchpolo's Avatar
Member
 
Join Date: Sep 2007
Location: Nevada
Posts: 92
I have an automated process that I need to produce incremental filenames so that when the sql process runs multiple times the file will be incremented, but I cannot find or figure out how to write this code.

For example, arcca_daily_incoming_1.asc , this is the filename for the first run then when the process executes again on the same the the filename would be arcca_daily_incoming_2.asc then arcca_daily_incoming_3.asc .. make sense?

Can someone assist me with the code or point me where I can mirror the code? I have never written this kind of process before.

You assitance will be appreciated.

Thanks.
  #2  
Old July 8th, 2009, 05:11 PM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,914
Provided Answers: 1

re: Filename Increments


Will the process execute once, meaning all these files will be created at once? Or your process will execute in a defined frequency that it will start from the last file created from the previous process and go from there?


--- CK
  #3  
Old July 8th, 2009, 05:47 PM
benchpolo's Avatar
Member
 
Join Date: Sep 2007
Location: Nevada
Posts: 92

re: Filename Increments


The process is automated so if it runs succesfully for that day it will be arcca_daily_incoming_1.asc, but if the automated process is run manually it should not create arcca_daily_incoming_1.asc instead it should increment to arcca_daily_incoming_2.asc
  #4  
Old July 8th, 2009, 08:33 PM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,914
Provided Answers: 1

re: Filename Increments


In that case, you have to check first if there are existing files on your target folder. If there are, you have grab the last increment number and start from there, if no file are existing, start from 1, then loop. You have to do all this using dynamic query.

Happy Coding!

--- CK
  #5  
Old July 29th, 2009, 08:14 PM
Newbie
 
Join Date: Jun 2008
Posts: 25

re: Filename Increments


Perhaps it would be more useful if you used a time/date combination to name your erudite files. As your process continues to run, filename_#.ext becomes less useful to placing the file name into a useful context such as when an event/error occurred.

That's it. I'm out of change.

That was my last two cents.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 09:56 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 03:15 AM
Snoopy futureofphp answers 4 July 27th, 2005 11:25 AM