Solved

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

  • 11 July 2018
  • 6 replies
  • 38 views

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?

icon

Best answer by jneujens 12 July 2018, 10:17

View original

6 replies

Userlevel 4
Badge +30

Hi @emorris4

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

Thanks,

Danilo

Badge

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.

Thanks for the help!

Userlevel 4
Badge +30

Thanks for the help!

You are wellcome :)

 

 

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.

 

 

Badge

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.

Reply