Skip to main content

I'm pulling my hair out trying to get filecopy writer to work. What I want to do is copy a folder (and it's sub-folders) to a new location and to rename the copied folder. I'm using user-parameters to prompt for the new folder name but I can't get the file copy to work properly. I've combed through old forums but haven't found anything helpful. I think I can do the renaming with a system caller but I still cant get the filecopy to work... Any help is much appreciated.

 

I feel like this is fairly straight-forward, I'm still quite new to FME.

Hi @mackenziebudda

In the attribute Destination Folder ( transformer AttributeCreator ) , please include:

 

Thanks in Advance,

Danilo

Hey @danilo_fme,

 

It worked! thanks for the help. The only thing now though is that it's not replacing the name of "new project template " with my @value(Project_WO_name). Instead it just creates a new folder with the @value(Project_WO_name) name and the "new project template" folder is nested inside.

 

Any suggestions?


Hey @danilo_fme,

 

It worked! thanks for the help. The only thing now though is that it's not replacing the name of "new project template " with my @value(Project_WO_name). Instead it just creates a new folder with the @value(Project_WO_name) name and the "new project template" folder is nested inside.

 

Any suggestions?

if you want to change the name of the file, the new name must be stored in an attribute called filecopy_dest_filename.


if you want to change the name of the file, the new name must be stored in an attribute called filecopy_dest_filename.

@jdh I thought I'am doing that. I created the attribute called "Project_WO_name". This attribute is then passed to the filecopy writer.


@jdh I thought I'am doing that. I created the attribute called "Project_WO_name". This attribute is then passed to the filecopy writer.

Is filecopy_dest_dataset an absolute or relative path?

 

Is filecopy_source_dataset and individual file, or a folder? Does it contain wildcards?

Is filecopy_dest_dataset an absolute or relative path?

 

Is filecopy_source_dataset and individual file, or a folder? Does it contain wildcards?

@jdh

The filecopy_dest_dataset is an absolute path. I have an attribute creator going into the filecopy that sets that attribute as "U:\\2020\\..."

The attribute creator also sets the filecopy_source_dataset as "T:\\2020\\folder_template" where folder_template is a folder with a few empty sub-folders


If I understand correctly you have something like

 

 

T:\\2020\\folder_template\\subfolder\\etc.

 

 

you want

U:\\2020\\ProjectWO\\subfolder\\etc

 

 

but you are currently getting

 

 

U:\\2020\\ProjectWO\\folder_template\\subfolder\\etc

If I understand correctly you have something like

 

 

T:\\2020\\folder_template\\subfolder\\etc.

 

 

you want

U:\\2020\\ProjectWO\\subfolder\\etc

 

 

but you are currently getting

 

 

U:\\2020\\ProjectWO\\folder_template\\subfolder\\etc

@jdh Thats exactly what's happening


@jdh Thats exactly what's happening

I don't have 2019 on this computer.

 

Can you try creating a fresh workspace with

 

A creator, attributecreator and fileCopy writer.

On the filecopyWriter set the Destination File Copy Folder to C:\\ (or a temp drive, it's irrelevant, but it will be created if it doesn't exist) and then unlink from user parameter.

Create the projectWO user parameter

 

 

The attributeCreator should have the following two attributes

filecopy_source_dataset: T:\\2020\\folder_template

filecopy_dest_dataset: U:\\2020\\$(Project_WO_name)

 

In FME 2020 that produces the correct results.


Reply