Skip to main content
Solved

How to rename a file when using filecopy to move them to a new location.


I am reading all JPGs contained in a location (including subfolders) and manipulating the attributes. Then, using the filecopy writer, I am moving them to a new location. I am having a hard time getting them to move with the name I am defining in the Text Editor. The original name is retained every time. Does anyone have some advice for me?

Best answer by jneujens

Just make sure the original input path is in the attribute filecopy_source_dataset. The folder you want to move them to should be the attribute filecopy_dest_dataset. The name of each JPEG can be whatever and should be in the attribute filecopy_dest_filename.

 

 

I recommend using an inspector just before the filecopy writer to verify that this is the case.
View original
Did this help you find an answer to your question?

6 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • July 11, 2018

Hi @emorris4

You can use the transformer AttributeManager and configure the attribute fme_basename like this image bellow:

Thanks,

Danilo


jneujens
Forum|alt.badge.img
  • Best Answer
  • July 12, 2018

Just make sure the original input path is in the attribute filecopy_source_dataset. The folder you want to move them to should be the attribute filecopy_dest_dataset. The name of each JPEG can be whatever and should be in the attribute filecopy_dest_filename.

 

 

I recommend using an inspector just before the filecopy writer to verify that this is the case.

  • Author
  • July 13, 2018

Thanks for the help!


danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • July 13, 2018
emorris4 wrote:

Thanks for the help!

You are wellcome :)

 

 


  • October 20, 2022

I'm struggling exactly with this same issue as the original question is.

I do get the files moved but cannot get the name updated. Having filecopy_dest_filename defined does not make any difference as to me it seems FME version 2022.1 File Copy transformer don't understand filecopy_dest_filename at all!?

imageAs you see, in the File Copy transformer I only get filecopy_source_dataset visible.

I've added those 2 other attributes as well but those won't make any difference.

 

 


dmerrick
Contributor
Forum|alt.badge.img+1
  • Contributor
  • December 1, 2022
_jami_ wrote:

I'm struggling exactly with this same issue as the original question is.

I do get the files moved but cannot get the name updated. Having filecopy_dest_filename defined does not make any difference as to me it seems FME version 2022.1 File Copy transformer don't understand filecopy_dest_filename at all!?

imageAs you see, in the File Copy transformer I only get filecopy_source_dataset visible.

I've added those 2 other attributes as well but those won't make any difference.

 

 

@_jami_​  check your warnings, file copy ignores the destination file name if it does not consider the source dataset as a file. I have a workspace that works correctly because it is renaming pdf's, but another that does not work due to trying to rename a geodatabase.


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