Skip to main content
Question

How to select a latest modified date SDF file in a folder?

  • December 7, 2015
  • 2 replies
  • 75 views

Forum|alt.badge.img

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.

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

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • December 7, 2015

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.


tim_wood
Contributor
Forum|alt.badge.img+8
  • Contributor
  • July 20, 2018

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.