Rename files after foldername

Post Reply
jepsenartworks
Newbie
Posts: 2
Joined: Thu Jan 31, 2013 11:36 am

Rename files after foldername

Post by jepsenartworks »

Hi, my problem is, that i need to add the name of a folder that contains my .pdf-files to those files. I tryed it with rename job, but i dont know much about scripting or java.



Could anyone help me with my problem?



Cheers!



Ben
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Rename files after foldername

Post by freddyp »

I do not think you will need to use any scripting, but you have not given a lot of information to be able to judge this. How are you submitting the files, a hot folder, a hierarchy? What are you submitting, files or folders? Please describe the process in more detail and give examples. Sometimes a little detail can make a big difference for the way in which best to solve a certain situation.



Freddy
jepsenartworks
Newbie
Posts: 2
Joined: Thu Jan 31, 2013 11:36 am

Rename files after foldername

Post by jepsenartworks »

Okay,



There is a Folder with pdf´s inside which will be downloaded

via FTP into my Hotfolder.



I want to add the name from the folder (not the hotfolder),

to the pdfs and then those renamed pdf files move on, to the next steps in my flow.


freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Rename files after foldername

Post by freddyp »

Easy enough: set "Attach hierarchy info" to "Yes' on the "FTP receive" element. Take care of the number of folder levels. The default is 1, but this means that only the top folder name is remembered, so you may have to increase that number when the folders that are being downloaded are further down in the hierarchy. If that is the case and you only need the folder name, you also have to specify not to save the top subfolder names.



In the "Rename" element you can then select to add a suffix to filename proper using the variable [Job.Hierarchy]. There too you can still manipulate the hierarchy string by defining "Before" or "After".



Freddy
Post Reply