Sep-27-2022, 08:11 PM
new detail
So it would def need to look at ONLY files that start with igMess and contain 2 underscores ( _ )
seems we have older files that are formatted like this:
igMess_1.csv
igMess_2.csv
The newer format is:
igMess_1_.csv
igMess_2_.csv
So only care to look at these and return the next highest number.
I have this sample script im playing around with, but not sure how to only consider the files with 2 of those underscores.
So it would def need to look at ONLY files that start with igMess and contain 2 underscores ( _ )
seems we have older files that are formatted like this:
igMess_1.csv
igMess_2.csv
The newer format is:
igMess_1_.csv
igMess_2_.csv
So only care to look at these and return the next highest number.
I have this sample script im playing around with, but not sure how to only consider the files with 2 of those underscores.
# iterate over files in # that directory for filename in os.listdir(directory): f = os.path.join(directory, filename) d = filename # checking if it is a file if d.startswith("igMess_"): print(d)