Hi
I need to find any way to put a file in a folder there I only knew some of the name.
Like this;
Folder is named 123456-1_abcd..
And I only knew the 123456-1 part.
So I tryed to set the hierarchy to that, but then it makes a new folder with that name. How can I match the two?
Use wildcards in set hierarchy
Use wildcards in set hierarchy
Between jobs!
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Use wildcards in set hierarchy
I implemented something similar in Javascript by enumerating the directories and doing partial name matching. Not sure you can do that with Archive Hierarchy directly.
Use wildcards in set hierarchy
No, "Archive hierarchy" will indeed not do this directly. Nor should it. "Archive hierarchy" places the job in whatever path is in the Hierarchy attribute at that point in time. So, what you need to do is make sure that the Hierarchy contains the correct values. It is perfectly possible to do what you want, but it will indeed require a script expression somewhere to add the correct part to the hierarchy path.
Freddy
Freddy
Use wildcards in set hierarchy
Ok. Thanks for the answer.
How can that solution look like? I will always have the first section, in the filename or in the meta data, but the second part is not possible to get until It's time to put the file in the folder.
How can that solution look like? I will always have the first section, in the filename or in the meta data, but the second part is not possible to get until It's time to put the file in the folder.
Between jobs!
Use wildcards in set hierarchy
Not tested, but here is what the script expression could look like. Of course you will have to set the path to the directory and you may want to return something else when the folder is not there; that is up to you. The script expression goes in a "Set hierarchy path" at the place and with the other settings you require to get the correct path.
var folder = new Dir("/path/to/folder/where/destination/is");
var dirList = folder.entryList("*",Dir.Dirs,Dir.Name);
var destinationFolder = "";
for (var i=0; i<dirList.length; i++) {
if (dirList.startsWith(job.getNameProper()) == true) {
destinationFolder = dirList;
}
}
destinationFolder;
var folder = new Dir("/path/to/folder/where/destination/is");
var dirList = folder.entryList("*",Dir.Dirs,Dir.Name);
var destinationFolder = "";
for (var i=0; i<dirList.length; i++) {
if (dirList.startsWith(job.getNameProper()) == true) {
destinationFolder = dirList;
}
}
destinationFolder;
Use wildcards in set hierarchy
Thanks!
It worked just perfect. I had to rename my files to just the correct "folder name", the first 123456-1 part, then the file finds the right folder (123456-1_abcd)..
If the folder is'n there, the file just lays outside the folders.. But that should not be any problem, the folder should be there.
It worked just perfect. I had to rename my files to just the correct "folder name", the first 123456-1 part, then the file finds the right folder (123456-1_abcd)..
If the folder is'n there, the file just lays outside the folders.. But that should not be any problem, the folder should be there.
Between jobs!