Skip to main content
Hello all,

 

 

i got a simple workspace set up where i am using the FILECOPY writer to simply copy a set of photos and rename them according to a user parameter, i manually put in the date the photo was taken,

 

the source and destination folder are also controlled by User Parameters and change every time,

 

 

is there a way i can get FME to read the first file in the folder and extract the Date Stamp, every time i run the workspace,

 

i know that i can import a dataset within User Parameters but this is not dynamic when i change the source folder.

 

 

maybe WorkSpaceRunner could play a role??

 

 

many thanks for your help

 

 
Hi

 

 

You could indeed use a first workspace to extract the info and then pass it on to a second workspace that does the processing.

 

 

If you're fairly familiar with Python, there are also Python scripted parameters (https://knowledge.safe.com/articles/How_To/Python-and-FME-Basics) that could accomplish the same thing in one workspace, but you would have to write a few lines of code to make it happen.

 

 

David
what would be the best way for me to use the WorkspaceRunner? 

 

i am struggling to work out how to extract the data from the first file within the folder,
Hi

 

 

you can use the "Directory and File Pathnames" reader, just remember to select "Retrieve file properties":

 

 

 

 

You will then get one feature per file or directory, each with lots of  extra attributes, e.g. path_created_date.

 

 

For your second workspace, you need to create appropriate published parameters. These will then appear in the WorkspaceRunner in your first workspace, so that you can pass attributes into them.

 

 

Lots of info here: https://knowledge.safe.com/articles/Samples_and_Demos/WorkspaceRunner

 

 

David

 

 
hey David, thanks for the reply,

 

 

what i am trying to get is the Datestamp from a .JPEG, using this method i am getting the date the file was created not when the photo was taken.

 

cheers
Hi,

 

 

Use a jpeg (or format relevant to you) reader in dynamic mode (advanced browser in reader and add directory etc.) . If there is exif data it will retrieve it. (fme2014 used)
expose the required attributes if you want to use them. Look in navigator for namingconvention.

Reply