Skip to main content
Question

Rename image file name to match data in spreadsheet

  • May 28, 2021
  • 1 reply
  • 98 views

I have hundreds of image files that require renaming.

I have an Excel sheet with the oringinal file names in one column and in another colomn the prefered file name. I would like to replace the image file (.jpg) name with the new name the column in the spreadsheet. I found an article on how to do this, but I can't seem to get the script to work. I am new to FME. I have provided the workbench file and the spread sheet and a image file.

Can some one please help guide me with where I am going wrong?

1 reply

nielsgerrits
VIP

I always find the FileCopy Writer not as intuitive as most other FME components and really need to dive in to get it working. As an alternative I prefer to use the SystemCaller transformer to do this with commandline:

rename "@Value(current_filepath)" "@Value(new_filename)"

so you get something like

rename "C:\Temp\New folder (4)\files\old.txt" "new.txt"

for each file.

2021-05-28_06h17_48Added a sample workspace demonstrating this. I prefer to doublecheck and the commandline manually before running it all through the SystemCaller.

 


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