Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have one problem i am thinking how to solve. My workbench is started from python script. Workbench reads xml file, but name of xml file is each time different. So is it possible to solve this with generic reader or with another python script which will read folder where is xml file, find the name of xml file and proceed it to the fme as a reader? Any other idea?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

Assuming you have only the one file you need to read in a directory of its own, you can setup your reader to read the directory for any and all .xml files. Right-click on your reader, select Update.., click on the "+" button, add the directory, and remove the reference to the direct .xml file that you probably already have. FME will now read any xml file in that directory, even if the name changes. I have done this in the past with .dwg files also. Just tested it with a xml file by running the workspace, changing the filename, then running again. It read the xml file everytime and recognized the filename change in the fme_basename attribute, which I had exposed.

enter image description here

That is the simplest approach. You could also use a startup Python script and have it read the directory, then feed the filename into the workflow.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.