Skip to main content
Solved

Guess format from dataset and add folder

  • September 4, 2017
  • 2 replies
  • 15 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

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • 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+11
  • 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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings