Skip to main content
Solved

Use variable file for input


geo-x
Supporter
Forum|alt.badge.img+6

Dear people,

I've to use zip files for input, and this file name is the actual date so that change everything, how can I do for that ?

Thank you for your help.

Best answer by lars_de_vries

Hi @lalandexavier,

I think the best way to solve this, is to start with a Creator transformer, followed by an AttributeCreator. Within the AttributeCreator you can set an attribute containing the current date and additional information if you like. For example:

@DateTimeNow(%Y%m%d).zip

The example would return 20180328.zip as attribute value, since todays date is March 28th, 2018.

This attribute can be used in a FeatureReader, where you choose your filetype and set the dataset to a path and the attribute. 

You could add the path to the attribute, but you could also make a Parameter to set the path. That is up to you.

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

7 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • March 28, 2018

Hi @lalandexavier

Let me know if i did understand your case: do you have zip files and the name of these files are the actual date.

What would you like to do after read these files?

Thanks,

Danilo


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • March 28, 2018
danilo_fme wrote:

Hi @lalandexavier

Let me know if i did understand your case: do you have zip files and the name of these files are the actual date.

What would you like to do after read these files?

Thanks,

Danilo

Hello danilo_fme and thank you for your help.

 

It's exactly that, I need to send it in a Gdrive space :-)

 

 


lars_de_vries
Forum|alt.badge.img+10

Hi @lalandexavier,

I think the best way to solve this, is to start with a Creator transformer, followed by an AttributeCreator. Within the AttributeCreator you can set an attribute containing the current date and additional information if you like. For example:

@DateTimeNow(%Y%m%d).zip

The example would return 20180328.zip as attribute value, since todays date is March 28th, 2018.

This attribute can be used in a FeatureReader, where you choose your filetype and set the dataset to a path and the attribute. 

You could add the path to the attribute, but you could also make a Parameter to set the path. That is up to you.


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • March 28, 2018
lars_de_vries wrote:

Hi @lalandexavier,

I think the best way to solve this, is to start with a Creator transformer, followed by an AttributeCreator. Within the AttributeCreator you can set an attribute containing the current date and additional information if you like. For example:

@DateTimeNow(%Y%m%d).zip

The example would return 20180328.zip as attribute value, since todays date is March 28th, 2018.

This attribute can be used in a FeatureReader, where you choose your filetype and set the dataset to a path and the attribute. 

You could add the path to the attribute, but you could also make a Parameter to set the path. That is up to you.

Hi  lars_de_vries and thank you for you reply.

 

 

I try to manage my FeatureReader but my file is rejected :

 

0684Q00000ArMP5QAN.jpg

 


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • March 28, 2018
lars_de_vries wrote:

Hi @lalandexavier,

I think the best way to solve this, is to start with a Creator transformer, followed by an AttributeCreator. Within the AttributeCreator you can set an attribute containing the current date and additional information if you like. For example:

@DateTimeNow(%Y%m%d).zip

The example would return 20180328.zip as attribute value, since todays date is March 28th, 2018.

This attribute can be used in a FeatureReader, where you choose your filetype and set the dataset to a path and the attribute. 

You could add the path to the attribute, but you could also make a Parameter to set the path. That is up to you.

It's perfect but in my case I used the transformer GoogleDriveConnector in addition to the transformer AttributeCreator.

 

 

For information the format @DateTimeNow(%Y%m%d) didn't works I used @DatetimeFormat(@DateTimeNow(),%Y%m%d)

 

 


danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • March 28, 2018
lars_de_vries wrote:

Hi @lalandexavier,

I think the best way to solve this, is to start with a Creator transformer, followed by an AttributeCreator. Within the AttributeCreator you can set an attribute containing the current date and additional information if you like. For example:

@DateTimeNow(%Y%m%d).zip

The example would return 20180328.zip as attribute value, since todays date is March 28th, 2018.

This attribute can be used in a FeatureReader, where you choose your filetype and set the dataset to a path and the attribute. 

You could add the path to the attribute, but you could also make a Parameter to set the path. That is up to you.

Good job @lars_de_vries

lars_de_vries
Forum|alt.badge.img+10
geo-x wrote:
It's perfect but in my case I used the transformer GoogleDriveConnector in addition to the transformer AttributeCreator.

 

 

For information the format @DateTimeNow(%Y%m%d) didn't works I used @DatetimeFormat(@DateTimeNow(),%Y%m%d)

 

 

Good to see you worked it out @lalandexavier

 


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