View previous topic :: View next topic |
Author |
Message |
bleph
Joined: 11 Apr 2007 Posts: 6
|
Posted: Thu Apr 12, 2007 1:28 am Post subject: output directory / folder of resultant renamed files |
|
|
Is this an option that I am missing...I want to specify an *DIFFERENT* output directory for my renamed files...
thanks
mark |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Thu Apr 12, 2007 6:31 am Post subject: |
|
|
There isn't a configurable option for moving files.
However, you can move files using the 'path builder' feature to change the path of the files **relative** to the current folder. i.e. You can move files to adjacent folders, or up 3 levels, or into subfolders. The path specified has to be relative to the adjacent folder.
e.g.. you can change the name of the file:
c:\Test\Music\mysong.mp3
to:
c:\Test\NewMusic\mysong.mp3
by using a search/replace pattern of:
Row: 1
Search: '(?B)(.*)'
Replace: '../NewMusic/\1'
The search string puts the entire filename in the first replace group. The name then has it's path modified.
You can change the name of the file first and then apply the path builder too. More details about the path builder regex flag is in the built-in help manual
Not sure if that helps.
Let me know if you'd like more information. |
|
Back to top |
|
 |
bleph
Joined: 11 Apr 2007 Posts: 6
|
Posted: Thu Apr 12, 2007 11:05 am Post subject: |
|
|
I need to regularly scan through a folder that has hundreds of subfolders. each subfolder has 8-10 files.
My goal is to create a new directory, with ALL renamed images
Master Folder
foldername1
file1
file2
file3
foldername2
file1
file2
file3
I am creating: want to)
NEW MASTER FOLDER
foldername1_file1
foldername1_file2
foldername1_file3
foldername2_file1
foldername2_file2
foldername2_file3
foldername2_file4
thankyou
mark |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Thu Apr 12, 2007 11:55 pm Post subject: |
|
|
You can accomplish what you want with the following entries in the custom table (don't include the single quotes):
Row: 1
Search:
Replace: '*Insert Folder before*All*'
Custom Format String for Insertion:
'%P1Folder%'
Row: 2
Search: '(?B)(.*)'
Replace: '../NEW MASTER FOLDER/\1'
All the renamed files will be moved to the NEW MASTER FOLDER and will be prefixed with their former parent folder names.
Beware - there is one side-effect with this method. The files will be moved one by one to their new destinations but when the last remaining file from a folder is moved, that folder will also disappear.
Let me know if this is undesirable behaviour. It's possible to add an option so that the folder will not disappear.
Hope this helps!
Last edited by admin on Sat Apr 14, 2007 1:50 pm; edited 1 time in total |
|
Back to top |
|
 |
bleph
Joined: 11 Apr 2007 Posts: 6
|
Posted: Fri Apr 13, 2007 12:04 pm Post subject: |
|
|
hmm.no I absoulutely need to leave the original file/folder structure untouched....and this process of rename is something i would want to run repeatedly, as data into the main set of folders is added/modified..
would you consider adding a direct line/variable for output dir of renamed files? In which a user could specify destination and the original files remaine the same...
I would imagine that the if the file existed in the designated output path (e.g. had been previously created)..there would be a switch to leave alone, etc..and not write over etc
thank you
mark |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sat Apr 14, 2007 1:23 am Post subject: |
|
|
Copying to a new destination with overwrite/no-overwrite options will go on the future feature list.
For now you could make at copy of the folder hierarchy, then run PFrank and designate that renamed files will go to the NEW MASTER FOLDER under the original hierarchy. When the renaming is done the files and folders under the copied hierarchy should be gone. |
|
Back to top |
|
 |
bleph
Joined: 11 Apr 2007 Posts: 6
|
Posted: Sat Apr 14, 2007 2:35 am Post subject: stuck |
|
|
i'm not getting where to place the '%P1Folder%' in the program..
mar |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sat Apr 14, 2007 3:33 am Post subject: |
|
|
I already gave you the info for the search/replace rows. Use that and just change the row with the:
'../NEW MASTER FOLDER/\1' to the correct relative path.
Don't specify the '%P1Folder%' in the custom rows; that is just extra information. Sorry if that was confusing.
i.e. just use:
Row: 1
Search:
Replace: '*Insert Folder before*All*'
Row: 2
Search: '(?B)(.*)'
Replace: '../NEW MASTER FOLDER\1'
The '%P1Folder%' was just extra information and specifies which folder name you are going to insert in the row 1 command. '%P1Folder%' is the default value which is configured in the Option Window. If you want to change the folder name which is inserted, then from the main window choose View -> Options...
The Options window then pops up. From there choose Parent folder name insertion. I'm assuming you want the parent folder (P1Folder) and wouldn't want any of the grand-parent folder names.
Last edited by admin on Sat Apr 14, 2007 1:51 pm; edited 1 time in total |
|
Back to top |
|
 |
bleph
Joined: 11 Apr 2007 Posts: 6
|
Posted: Sat Apr 14, 2007 12:45 pm Post subject: |
|
|
I seem to be missing something still
the output view shows
..\outputdirparentfolder_filename.jpg
it seems that there is a \ missing
ought to look like
..\outputdir\parentfolder_filename
i have 3 lines
1. replace : *Insert Folder before*All*
2. _
3 search (?B)(.*) replace ../Output Dir\1
[/img] |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sat Apr 14, 2007 1:50 pm Post subject: |
|
|
Sorry - you're right. I missed a '/'.
The last row should be:
search (?B)(.*) replace ../Output Dir/\1
For the replace expression you have to use '/' and not '\' to separate folder levels. |
|
Back to top |
|
 |
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Sun Jul 15, 2007 6:28 am Post subject: |
|
|
There will be a new option so that you can choose whether you want the parent folder to disappear after the
last remaining file from that folder is moved.
This will be available in 2.03.
Peter. |
|
Back to top |
|
 |
|