Page 1 of 1

Preset Help

Posted: 03 Nov 2018, 11:21
by blackmantis1
Can someone help me create a preset to remove a string before the filename. For example the file name is "Wu Tang Collection- Killer Elephants" I would like it to be renamed to "Killer Elephants". Sometimes the prefix varies by the hyphen location Wu Tang Collection-, Wu Tang Collection -, Wu Tang Collection -.

Thanks

Re: Preset Help

Posted: 03 Nov 2018, 17:01
by kim
ez

Code: Select all

{
fn.replaceAll(/Wu Tang Collection\s?-\s?/)
}
or

Code: Select all

{
fn.replaceAll(/\w.+Collection\s?-\s?/)
}
or

Code: Select all

{
fn.after(/Collection\s?-/)
}
btw: use this
viewtopic.php?t=2072

Re: Preset Help

Posted: 03 Nov 2018, 20:19
by blackmantis1
Thanks for your help Kim. But neither of the code snippets work. Im using the platform version. Here is a paste from hitting F7
Wu Tang Collection - Evidence.mkv null
Wu Tang Collection - From Bangkok With Orders To Kill.mkv null
Wu Tang Collection - Infernal ST - ENGLISH Subtitled.mkv null
Wu Tang Collection - Invincible Buddhism Kung Fu -ENGLISH Subtitled.mkv null
Wu Tang Collection - Kung Fu Kids - Dick Wei - ENGLISH Subtitled.mkv null
Wu Tang Collection - Lackey and the Lady Tiger.mkv null
Wu Tang Collection - MAD DRAGON (English Subtitles).mkv null
Wu Tang Collection - Out Of Danger - ENGLISH Subtitled.mkv null
Wu Tang Collection - Panna Rittikrai in Black Killer.mkv null

Re: Preset Help

Posted: 04 Nov 2018, 02:53
by kim
kim wrote: 03 Nov 2018, 17:01 btw: use this
viewtopic.php?t=2072
Are you sure, you are using:
Batch Rename any type of file

Post by rednoah » 13 Oct 2014, 21:47
As a hidden bonus feature, FileBot supports quick and efficient generic batch renaming, and you can rewrite the filenames with awesome Groovy expressions just like in Episode / Movie mode.

1. Drop files into Original Files
2. Click on the empty New Names component
3. Now that New Names has focus hit F2
4. New Names will instantly filled with File objects (or Episode / Movie objects if xattr metadata has previously been stored)
5. Double Click any item in New Names to apply a new Format Expression

:idea: Create Presets for repetitive tasks.

:idea: Hit F2 after selecting an item to edit the name.
try it out here
https://regexr.com/42f3v

Re: Preset Help

Posted: 05 Nov 2018, 04:44
by blackmantis1
Thanks it worked. I wasn't completing the steps on the batch rename. Now I know how it works. Where can i go learn more about scripting for this tool?

Re: Preset Help

Posted: 05 Nov 2018, 16:20
by rednoah
More info on FileBot Format Expressions:
https://www.filebot.net/naming.html

:idea: Format Expressions are based on Groovy, which in turn allows you to leverage the entire Java API, hence Java / Groovy basics (especially the APIs) will be extremely helpful. FileBot just adds a little bit (in terms of convenience methods) on top of that.

:idea: Note that there's also command-line shell scripts, as well as FileBot Groovy scripts, and not to be confused with format expressions.