Page 1 of 1

Rename files after foldername

Posted: Fri Feb 01, 2013 11:21 am
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

Rename files after foldername

Posted: Fri Feb 01, 2013 11:59 am
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

Rename files after foldername

Posted: Fri Feb 01, 2013 12:20 pm
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.



Rename files after foldername

Posted: Fri Feb 01, 2013 3:00 pm
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