Skip to main content
Best Answer

Can I get FMEWorkspaceRunner to automatically read multiple files (one at a time) from a folder?

  • December 19, 2019
  • 2 replies
  • 49 views

Forum|alt.badge.img

I'm trying to demonstrate how FME (eventually FME Server) can automate a process for us. I have all of my NMEA data in one folder (they are stored by day in a given month; hence, there can be 700-800 NMEA files in each folder), and I can get the reader to read them all manually...but I would like to know if it's possible to get FMEWorkspaceRunner to automatically read and load all of the files in a folder that will then be converted.

The FMEWorkspaceRunner variable is set to: runner = fmeobjects.FMEWorkspaceRunner()

I tried to be sneaky and use parameters['SourceDataset_NMEA'] ='\\\\2018ais\\c$\\rawnema\\Feb2019\\*.nmea', but it did not work using runner.runWithParameters(workspace, parameters).

I can (of course) do it manually from Python by using runner.promptRun(workspace), but this then defeats the purpose of my Python script.

Is there a way to get the FMEWorkspace Runner to automatically read/load all of the files in a folder that will then be converted?

When loading all of the NMEA files manually from within the FMW it works perfectly, and converts all of the points directly into a file geodatabase.

Thanks

Best answer by ryanatsafe

I'd start with a `Directory and File Pathnames` reader to read in the file names. It will be a feature for each file. Then you can run those features through either the WorkspaceRunner or FeatureReader transformer.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ryanatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • Best Answer
  • December 19, 2019

I'd start with a `Directory and File Pathnames` reader to read in the file names. It will be a feature for each file. Then you can run those features through either the WorkspaceRunner or FeatureReader transformer.


Forum|alt.badge.img
  • Author
  • December 19, 2019

I'd start with a `Directory and File Pathnames` reader to read in the file names. It will be a feature for each file. Then you can run those features through either the WorkspaceRunner or FeatureReader transformer.

@ryanatsafe Thanks Ryan...I will give that a try next to see how it works. I'm almost there...I have a few Python scripts all able to automate a geoprocessing sequence...this is the last step :-).