Skip to main content
Best Answer

Use variable file for input

  • March 28, 2018
  • 7 replies
  • 43 views

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.

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.

7 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • 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

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

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

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
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • March 28, 2018

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