4

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?

asked Jan 27, 2012 at 13:54

1 Answer 1

5

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.

answered Jan 27, 2012 at 15:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.