Solved

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

  • 19 December 2019
  • 2 replies
  • 8 views

Badge

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

icon

Best answer by ryanatsafe 19 December 2019, 23:51

View original

2 replies

Badge

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.

Badge

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 :-).

Reply