Skip to main content
Question

FME If Else or Other Options to Sort Files by Filename

  • July 13, 2020
  • 2 replies
  • 29 views

Hi Everyone,

 

im new in FME and still learning a lot. I want to Sort some Files by their Filename.

For Example:

in Directory are few Files:

 

E006N52_ed2.zip

E025S23_ed4.zip

W312N34_ed1.zip

etc....

Now i want to Sort them by:

All E..... in one Way (Output on html as: All East Files)

All W.... in one Way (Output on html as: All West Files)

Hope u understand what i mean ;)

 

Greetings

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

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • July 14, 2020

You can use the FeatureWriter transformer with File Copy Format, the filecopy_dest_dataset set to a Conditional Value with Test Cluses set to filename Begins with E and W respectively and Expressions of the paths for each situation


davtorgh
Contributor
Forum|alt.badge.img+12
  • Contributor
  • August 11, 2020

Hi @zentalas​,

 

I'm not sure I got it right, but if you want to get an ordered dataset containing a filtered subset of the files in a directory (and subdirectory), you can use a Directory and File Pathnames Reader (check the attached screenshot for setup) followed by:

  • a Tester on the 'path_filename' attribute to get only the fatures (filenames) you want;
  • a Sorter on the same attirbute.

 

Hope that helps!