Thank you very much for your quick feedback. It took me a while to think through how to modify your above code to deal with my large-scale situation so that all the existing file names can contain the number of runs while avoiding to incur additional storage cost on the cloud. The situation I am thinking of requires changing the file name's of several output files when the same R script is run 200+ times.
For simplicity, suppose the number of output files is 3 (in reality, it can be 100). Also assume the first 10 runs belongs to the first 1st output file (i.e., this file is overwritten 10 times), the next 50 runs would give 2nd output file (i.e., this file is overwritten 50 times), and the next 40 runs would give 3rd output file (i.e., this file is overwritten 40 times). If the current naming convention of these 3 output files, as a result of running the same
R script 100 times, is
[Job ID]_DATE1_DATE2_[Sys.Date()], how could we modify the above code to have
[InfoJOB_ID]_DATE1_DATE2_[Sys.Date()]so that we only have 1 (potentially big)
CounterTrack_[JOB ID].txt files per each day, regardless of the number of Job IDs we have? I meant, how do we employ only 1
.txt file but being able to update the counter
Info that is placed into naming conventions of the 3 output files?