Skip to main content
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?


mcannalea12
Contributor
Forum|alt.badge.img+2
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?

8 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

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


mcannalea12
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • August 9, 2021

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.


mcannalea12
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • August 9, 2021
mcannalea12 wrote:

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.


mcannalea12
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • August 9, 2021

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".


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
mcannalea12 wrote:

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.


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
mcannalea12 wrote:

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!


riad.hamoudi
Contributor
Forum|alt.badge.img+1

Can you share an example of a workbench? They're driving me crazy 😤

I have about 3000 JPEG photos that I would like to rename using a field, with the new photo name.


riad.hamoudi
Contributor
Forum|alt.badge.img+1
riad.hamoudi wrote:

Can you share an example of a workbench? They're driving me crazy 😤

I have about 3000 JPEG photos that I would like to rename using a field, with the new photo name.

Finally, my colleague from the office, who has more experience with FME, let me know that my output fields were not selected, see point 4 in the photo. It’s working now. Merci

 


Reply


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