Skip to main content

Hi All,

I have a folder of csv files with the naming convention like this : Insp1.csv, Obsv1.csv, Insp2.csv, Obsv2.csv etc etc.

I have written a workbench to read in Insp1.csv and Obsv1.csv and derive the outputs i want. These csv files are pairs and both are needed to create the output. 

I have a folder of many InspX.csv and ObsvX.csv files that I want to process. 

I have set up a Directory and File Pathnames reader than I think I want to pass into a workspace runner that calls the workbench to process the files with parameters.  How to I get FME to iterate over my files and each time the runner is called iterate to the next pair of csv’s? ie first time is run use Insp1.csv and Obsv1.csv, the second time use Insp2.csv and Obsv2.cvs etc etc

Many Thanks Goatboy

One way to do this is to use the Directory and File Pathnames FeatureReader, read the directory with files as features and use these as initiators for the workspacerunner.


One way to do this is to use the Directory and File Pathnames FeatureReader, read the directory with files as features and use these as initiators for the workspacerunner.

Thanks Niels, i think I'm missing something here. How does fme know which pair of files to use? ie 1 and 1, then 2 and 2 etc ? Could you please elaborate a bit for me.  thanks 


In the child workspace, you need published parameters for the filepaths.

In the parent workspace, one you select the child workspace in the workspacerunner, you can point attributes to the published parameters. The Directory and File Pathnames reader outputs path_windows which has the path to the file.

In the parent you can build stuff to check for the two files to exist, use your imagination.

Attached sample workspace.