I'm seperating the Prelims and Early Prelims of my UFC fights as editions. How do I have it recognize either Prelims or Early.Prelims from the file name and make that the edition name (while also changing the . in "Early.Prelims" to a space)?
Starting with UFC.261.Usman.vs.Masvidal.2.Prelims.576p.AVC.mkv the output should be UFC 261 Usman vs. Masvidal 2 (2021) 720p AVC {edition-Prelims}.mkv
Satrting with UFC.261.Usman.vs.Masvidal.2.Early.Prelims.576p.AVC.mkv should be UFC 261 Usman vs. Masvidal 2 (2021) 720p AVC {edition-Early Prelims}.mkv
I've got the rest of it, I just can't figure out how to automate the {edition-*******} part.
Tanks for any tips you can give.
How can I add {edition-"words from file name"} to file?
-
- Posts: 3
- Joined: 08 Apr 2024, 01:04
-
- Posts: 3
- Joined: 08 Apr 2024, 01:04
Re: How can I add {edition-"words from file name"} to file?
I think I figured it out. I used the following and it seems to work as desired:
Groovy: Select all
{ ny.colon(' ') } {vf} {vc}
{
def ufc = fn.matchAll(/Prelims|Early.Prelims/)
def edition = ufc.join(' ').replace('.':' ')
'{edition-' + edition + '}'
}
Re: How can I add {edition-"words from file name"} to file?
Here's how I'd write it:
Match information from the file path
Format: Select all
{ ny.colon(' ') } { vf } { vc } { '{edition-' + fn.match(/Prelims|Early.Prelims/).space(' ') + '}' }
Please read the FAQ and How to Request Help.
-
- Posts: 3
- Joined: 08 Apr 2024, 01:04
Re: How can I add {edition-"words from file name"} to file?
That makes sense and is much cleaner. Thanks for the reply. Showed me how to use the + symbol correctly.rednoah wrote: ↑08 Apr 2024, 03:56 Here's how I'd write it:Match information from the file pathFormat: Select all
{ ny.colon(' ') } { vf } { vc } { '{edition-' + fn.match(/Prelims|Early.Prelims/).space(' ') + '}' }