Skip to main content

Hello,

I have a folder which contains many sdf files with different "last modified date" and file names. In my FME script, i'm only interested to READ the latest sdf file (1 file). May I ask how to select that file?

thank you.

You can use a Directory and Filepathnames reader. Then sort the data on path_modified_date.

Then use the Sampler to get the latest modification.


You can use a Directory and Filepathnames reader. Then sort the data on path_modified_date.

Then use the Sampler to get the latest modification.

I wanted the modified date of the Personal Geodatabase I'm reading a Feature Class from so I used your suggestion but with a Path Filter of the PGDB file name rather than the Sampler. Now I'm just working on making that date an attribute of all the features in the Feature Class...

 

Update: figured out a way:

 

I use the Counter on the Feature Class data to create values (_count) that will match the Cloner output (_copynum). These are the join fields in FeatureJoiner_4.

 

 

Both AttributeCreators create an attribute called _join_id with a value of 1 so the date modified will be merged with the Summary feature from the StatisticsCalculator (thanks to https://knowledge.safe.com/questions/5293/how-to-count-the-number-of-features-with-the-same.html).

 

 

Cloner uses the Total Count from StatisticsCalculator to create the required number of copies.

 


Reply