Question

Reading the file name of zip file


Badge

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

Userlevel 4
Badge +30

Hi @rocky12

Please, enable the format attribute fme_basename on the Reader:

 

 

Thanks,

Danilo

Badge

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?

Userlevel 3
Badge +26

@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.

Badge

@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.

Badge +2

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

Badge

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?

Badge +2

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