Skip to main content
Solved

Guess format from dataset and add folder

  • September 4, 2017
  • 2 replies
  • 43 views

Forum|alt.badge.img

Hello,

I am a FME beginner and I really love that whole folders can be added to a writer. However, I do have folders which contain many files of the same format each and I would like to add a folder to a reader and let FME guess the format of the files in that folder.

It seems that this is not possible but only one of the two (add folder OR guess format from dataset)?

thanks and best regards,

Ludwig

Best answer by pratap

Hi,

1. Use Format as Directory and File Pathnames

2. Use Attribute Filter based on path_extension attribute

3. Map the appropriate format to FeatureReader transformer and read the data as required

4. Disable the feature readers before running and check whether all the files are passed to feature readers and only unwanted features are in unfiltered port. If any valid features are present in Unfiltered port (like dgn file in the above example) then add the additional filter and feature reader. Once you are confirmed that you have left with unwanted (like shx,prj,dbf files of shape file are unwanted) in Unfiltered port then enable the feature readers and proceed.

Hope this help

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

takashi
Celebrity
  • September 4, 2017

Hi @ludhil, it seems that FME guesses the source format based on the file extension of a file when you set it to the Dataset field. FME cannot guess format from a folder path, but I think you can once set a file path containing the extension for your desired format to the Dataset field in order to let FME guess the format. You can then remove the file path and re-set the target folder.

Just be aware that FME doesn't always guess the source format correctly, since there are formats using the same extension.


pratap
Contributor
Forum|alt.badge.img+12
  • Contributor
  • Best Answer
  • September 4, 2017

Hi,

1. Use Format as Directory and File Pathnames

2. Use Attribute Filter based on path_extension attribute

3. Map the appropriate format to FeatureReader transformer and read the data as required

4. Disable the feature readers before running and check whether all the files are passed to feature readers and only unwanted features are in unfiltered port. If any valid features are present in Unfiltered port (like dgn file in the above example) then add the additional filter and feature reader. Once you are confirmed that you have left with unwanted (like shx,prj,dbf files of shape file are unwanted) in Unfiltered port then enable the feature readers and proceed.

Hope this help