Skip to main content
Solved

FILECOPY: a "Hello World" example please


mattwilkie
Supporter
Forum|alt.badge.img+11

Could someone please provide a dead simple "Hello World!" example of using the FILECOPY writer? Try as I might I can't figure out how to get this to work. Thanks.

 

This is what I've done so far:

  1. FME Workbench >> File new >> Blank workspace
  2. Writers >> Add >> FILECOPY
    1. Dataset: \\\\server\\share\\source folder >> OK
  3. Open "user attributes" and set:
    1. filecopy_source_dataset = "\\\\server\\share\\source folder\\filename.ext"
    2. filecopy_dest_dataset = d:\\temp
    3. filecopy_dest_filename = xx-my-filename.ext

 

At this point "Run Workspace" doesn't work. "Run to this" does work, but aside from filling the log window nothing appears to happen.

Workspace and log are attached.

 

 

Best answer by mattwilkie

A cleaner method is to use PATH reader (called "Directory and File Pathnames" in the Add Reader dialog), feed to Attribute Manager, and use Att-Man's outputs in File Copy:

PATH reader --> Atttribute Manager --> FILECOPY Writer flow diagram2022-07-27 10_31_16-_PATH → FILECOPY (Untitled) - FME Workbench 2022.02022-07-27 10_38_57-_PATH → FILECOPY (Untitled) - FME Workbench 2022.0There doesn't seem to be a way to stop FileCopy from creating a subfolder in the destination. 

 

Discovered by way of: https://community.safe.com/s/question/0D54Q00008q3xsMSAQ/i-have-a-fairly-simple-problem-but-cant-seem-to-figure-it-out-i-need-to-copy-one-excel-file-to-another-folder-and-rename-the-copied-file-ive-tried-using-the-path-reader-and-the-file-copy-writer-but-nothing-seems-to-get-copied-any-ideas?t=1655144604807

 

View original
Did this help you find an answer to your question?

4 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • April 14, 2021

Hi @mattw1ilkie​ 

 

Please, insert the trasformer Creator and execute your Workspace.

 

Creator_Workspace 

Thanks,

Danilo


mattwilkie
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • April 14, 2021

Ok, thank you. That was enough to get me to something workable.

For anyone else finding themselves in the same place I was there's a few quirks to be aware of:

  • When you add the filecopy writer the Dataset parameter it prompts for is the Destination folder, not input.
  • The actual parameters (source, target, filename) are set via User Attributes.
  • The help doc page says paths must use foreslash or double-backslash, but that's not the case for me (FME Desktop v2020.2) However:
    • Don't use quotes even if the path has a spaces.
  • If defined, the User Attribute "filecopy_dest_dataset" parameter overrides whatever is selected for Destination Dataset in the prompt when the workspace is run.

Here's my working example:

filecopy-working-example


mattwilkie
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • Best Answer
  • June 13, 2022

A cleaner method is to use PATH reader (called "Directory and File Pathnames" in the Add Reader dialog), feed to Attribute Manager, and use Att-Man's outputs in File Copy:

PATH reader --> Atttribute Manager --> FILECOPY Writer flow diagram2022-07-27 10_31_16-_PATH → FILECOPY (Untitled) - FME Workbench 2022.02022-07-27 10_38_57-_PATH → FILECOPY (Untitled) - FME Workbench 2022.0There doesn't seem to be a way to stop FileCopy from creating a subfolder in the destination. 

 

Discovered by way of: https://community.safe.com/s/question/0D54Q00008q3xsMSAQ/i-have-a-fairly-simple-problem-but-cant-seem-to-figure-it-out-i-need-to-copy-one-excel-file-to-another-folder-and-rename-the-copied-file-ive-tried-using-the-path-reader-and-the-file-copy-writer-but-nothing-seems-to-get-copied-any-ideas?t=1655144604807

 


marloes
Participant
Forum|alt.badge.img
  • Participant
  • October 11, 2023
mattwilkie wrote:

Ok, thank you. That was enough to get me to something workable.

For anyone else finding themselves in the same place I was there's a few quirks to be aware of:

  • When you add the filecopy writer the Dataset parameter it prompts for is the Destination folder, not input.
  • The actual parameters (source, target, filename) are set via User Attributes.
  • The help doc page says paths must use foreslash or double-backslash, but that's not the case for me (FME Desktop v2020.2) However:
    • Don't use quotes even if the path has a spaces.
  • If defined, the User Attribute "filecopy_dest_dataset" parameter overrides whatever is selected for Destination Dataset in the prompt when the workspace is run.

Here's my working example:

filecopy-working-example

Thank you, this is what I needed to get it working! thanks for taking the time to write back your findings!


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