Skip to main content
Question

Copy/rename data files from one environment to another

  • December 12, 2017
  • 2 replies
  • 42 views

At the end of our fiscal year, I would like to take the data that has "2018" in the title (a couple of feature classes and around 70 tables) and rename them to replace 2018 with 2019. Going from our production environment to our development environment. Using the readers and writers I see it can happen but I would need to manually edit the year. Is there an automated method that would replace the year in the title of each data file? I have not used FME before so this is all new to me.

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.

2 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • December 12, 2017

Hi @mrb11,

I believe that you need to expose the format attribute fme_basename:

After use the transformer StringReplacer and work with the attribute fme_basename it did enable before:

In Writer is necessary to select on Feature Type to select the attribute fme_basename and the navigator select the Fanout Expression:

Thanks,

Danilo

 

 


takashi
Celebrity
  • December 15, 2017

If the "title" in your description means file name, i.e. if you just want to copy files under a folder to another folder replacing "2018" within their file names with "2019", you can use the "Directory and File Pathnames" reader, some transformers to perform string operations, and the "File Copy" writer effectively.