Hello,
I am trying to add the first 5 numbers listed in the "title " metadata to the filename.
I need to rename thousands of files and numbers in title need to be used in the file name.
If you see the screenshot,
I start from "999.pdf ".. and it needs to be
BYL 11491 - 999.pdf
the 11491 is the first 5 numbers from the title metadata.
How can I do this?
Thank you
If you see the screenshot,
I start from "996.pdf ".. and it needs to be
BYL 11488 - 996.pdf
the 11488 is the first 5 numbers from the title metadata.
How can I do this?
Leo
June 8, 2015, 6:32pm
4
It should be possible using a rename script.
Is the "BYL" prefix that also needs adding hardcoded, or does that also come from somewhere and need to vary?
The BYL prefix will also start at the beginning of the filename. It will never change. I know how to add that using simple file rename command, i just do not know how to add the numbers from title to the filename...
thank you
MrC
June 10, 2015, 12:48am
7
Hi gbadesha,
You can do this now with the Dynamic Renamer :
The idea is simple, and the transformation is:
-$/___{title}/ -/^(.*)___(\d+).*$/BYL $1 - $2/
This is a two stage transformation, which:
adds the title string to the end of the filename, after some unique marker symbols (I chose three underscores).
-$/___{title}/
uses a regular expression to grab the pieces you want, and rearranges the output as per your requirements.
-/^(.*)___(\d+).*$/BYL $1 - $2/
Give it a shot!
Leo
June 10, 2015, 7:58am
8
PHPBB_IMPORT_WARNING CODE_NEAR_LI
Here's a simple rename script which does the same thing, and does not require you to install Perl (or anything else).
In the Rename dialog:
[ul][li]Set Old Name to * [/li]
[li]Set New Name to * [/li]
[li]Turn on Script Mode [/li]
[li]Paste this as the script:
@script vbscript
Function OnGetNewName(ByRef GetNewNameData)
TitleWords = Split(GetNewNameData.item.metadata.doc.title, " ")
If (UBound(TitleWords) >= 0) Then
OnGetNewName = "BYL " & TitleWords(0) & " - " & GetNewNameData.newname
End If
End Function
[/li][/ul]
With the Preview open, click Refresh to test that it works with your real files.
Here's what it should look like:
You can save it as a preset if you will need to use it again in the future, so you don't have to set it up manually again.
Note: I'm assuming Opus 11, so the script uses some things that won't work in earlier versions and allow it to be more concise.