Page 1 of 1

archive in new folder based on filename

Posted: Thu Jan 24, 2013 10:17 am
by ppmg
Hi there,



i'm new here. I'm Leon from PPMG the Netherlands. Been using Switch lite for years, and in the process of transferring to fullswitch (aquiring the extra modules) to further automate our workflows.



I have a question:



Is there a way to sort files by filename, make a folder from a part of this filename and put the file in that folder?





example:



12345_example.zip



should trigger:



make a folder with the name 12345 at location x



place the file 12345_example.zip in that folder





Looks like a scripting job?



Thanks in advance for your time,



Leon Dona

archive in new folder based on filename

Posted: Thu Jan 24, 2013 11:14 am
by carineb
Hi Leon,



you can achieve this without scripting, using the default Switch tools.



To setup, 2 parts are required:

1) gathering the name of how the folder should be named, this is done using the 'Set hierarchy path' tool

2) creating that particular folder in the correct location and place the job in the newly created folder - this can be done using the 'Archive hierarchy' tool





1) Remembering the folder name

- In the Set hierarchy path properties, choose 'Replace' as 'Action'

- Click in the 'value' field of 'Path segment 1'

- Choose 'Define single-line text with variables'

- In 'Groups' choose 'Job'

- In 'Job' variables' choose 'Name'

- In 'Job.Name (Text)' define the segment, in your sample the segment would be 1-5



2) Creating the subfolder and place the job in that folder

- In the 'Archive hierarchy', set the path to the folder you'd like to use as 'parent folder'

- The other properties can be kept as set by default for this case to work



Hope this helps you!



Kind regards,

Carine





archive in new folder based on filename

Posted: Thu Jan 24, 2013 1:11 pm
by ppmg
Thanks Carine,



works like a charm! :)



Leon