Skip to main content
Question

Reading the file name of zip file


Forum|alt.badge.img

Based on if reader zip file contains certain file name I need it to read the file name to determine the scripts path.

7 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • May 30, 2019

Hi @rocky12

Please, enable the format attribute fme_basename on the Reader:

 

 

Thanks,

Danilo


Forum|alt.badge.img
  • Author
  • June 20, 2019
danilo_fme wrote:

Hi @rocky12

Please, enable the format attribute fme_basename on the Reader:

 

 

Thanks,

Danilo

@danilo_fme this would work but new zip files will be coming in frequently with different file names and this would have to be done every time. Is there an automatic process/short cut for if readers will be changed out that it will read the file name prior to running?


dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • June 20, 2019
rocky12 wrote:

@danilo_fme this would work but new zip files will be coming in frequently with different file names and this would have to be done every time. Is there an automatic process/short cut for if readers will be changed out that it will read the file name prior to running?

@rocky12 fme_basename can be exposed with an AttributeExposer after the reader. That way you won't have to worry about exposing on new readers.


Forum|alt.badge.img
  • Author
  • June 20, 2019
dustin wrote:

@rocky12 fme_basename can be exposed with an AttributeExposer after the reader. That way you won't have to worry about exposing on new readers.

Would I be able to use FME Server to put in the new zip files and the reader would update? That way with the AttributeExposer the basename would stay with it.


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • June 24, 2019
rocky12 wrote:

Would I be able to use FME Server to put in the new zip files and the reader would update? That way with the AttributeExposer the basename would stay with it.

Hi @rocky12,

That should work, another option could be to use a generic reader as shown in the Easy Translator example on the FME Server Playground - you can download the template workspace here if you are interested in trying the generic reader approach: https://knowledge.safe.com/articles/1115/easy-translator-using-fme-server.html


Forum|alt.badge.img
  • Author
  • June 25, 2019
chrisatsafe wrote:

Hi @rocky12,

That should work, another option could be to use a generic reader as shown in the Easy Translator example on the FME Server Playground - you can download the template workspace here if you are interested in trying the generic reader approach: https://knowledge.safe.com/articles/1115/easy-translator-using-fme-server.html

What would the reader for this look like within FME desktop?


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • June 25, 2019
rocky12 wrote:

What would the reader for this look like within FME desktop?

@rocky12, using the Easy Translator example, there are a couple of possible configurations:

  1. Guess format name from extension (default)
  2. Parameterize the Input format which enables you to choose the input format.

 

In the Easy Translator example, a parameter is used to specify the format at runtime, you can do so after adding the reader to the canvas, as shown here:

Your browser does not support HTML5 video.

Template: Generic_Reader.fmw


Reply


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