melissatalley

Calling a file generated by a model which has a timestamp file name in Python

Discussion created by melissatalley on Nov 1, 2011
Latest reply on Nov 2, 2011 by mzcoyle
I have a model which generates an output file with a timestamp attached to its name. This is necessary so that multiple users of our geoprocessing service do not overwrite eachother's outputs.

Within my model I have a python script which performs matrix algebra on a column of values calculated within the model. The values are loaded into the python script from a txt file generated by the model with the timestamp in the file name using the numpy command loadtxt.

My problem is that I cannot figure out how to tell the script what file to look for since the file is named differently every time.

The file name is generated in my model using calculate value which uses python to import the current time, this variable is named date in my model. The textfile is named %date%value.txt 
Is there a way to reference the result of calculate value in the model in my python script? If not is there another way to load a txt file that is named a little differently every time such as a wildcard in front of value.txt?

Outcomes