Question

I have a fairly simple problem but can't seem to figure it out. I need to copy one excel file to another folder and rename the copied file. I've tried using the PATH reader and the File Copy Writer but nothing seems to get copied. Any ideas?

  • 7 August 2021
  • 6 replies
  • 37 views

Badge
I have a fairly simple problem but can't seem to figure it out. I need to copy one excel file to another folder and rename the copied file. I've tried using the PATH reader and the File Copy Writer but nothing seems to get copied. Any ideas?

6 replies

Userlevel 4
Badge +26

The path reader and File Copy writer is definitely the way to go. Try using an attribute manager to set the specific attributes needed for the file copy writer - use the 'path_windows' as the 'filecopy_source_dataset' and set 'filecopy_dest_filename' to be the new filename (just the filename, e.g., mynewname.xlsx).

 

For the output location of the FileCopyWirter set the folder you want the new file in.

Here's a little more info: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/filecopy/Feature_Representation.htm

Badge

Thank you, I finally was able to get it to copy and rename something, so progress! Unfortunately, it's not an excel file - in fact I can't even tell what kind of file it is. I've included a screenshot of the file it creates, along with my path and file copy parameters. Is something off? I thought filtering PATH to just grab excel files might fix the issue but it doesn't seem to be working.

Badge

Thank you, I finally was able to get it to copy and rename something, so progress! Unfortunately, it's not an excel file - in fact I can't even tell what kind of file it is. I've included a screenshot of the file it creates, along with my path and file copy parameters. Is something off? I thought filtering PATH to just grab excel files might fix the issue but it doesn't seem to be working.

Edit: I switched the screenshots up, path parameters are on the right, not the left.

Badge

Oh my god, crown me Supreme Idiot. I wasn't putting the file extension in the new file name. I was putting "Archive_Test" instead of "Archive_Test.xlsx".

Userlevel 4
Badge +26

Edit: I switched the screenshots up, path parameters are on the right, not the left.

It looks like you're very close. The file just seems to be missing it's extension. You will need to also specify that in the new filename. So Archive_Test.xlsx should be the new file name.

Userlevel 4
Badge +26

Oh my god, crown me Supreme Idiot. I wasn't putting the file extension in the new file name. I was putting "Archive_Test" instead of "Archive_Test.xlsx".

🤣🤣 - Glad you got there in the end!

Reply