Preset Help

Support for Windows 10 users and the Microsoft Store package
Post Reply
blackmantis1
Posts: 6
Joined: 24 Oct 2018, 21:43

Preset Help

Post by blackmantis1 » 03 Nov 2018, 11:21

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

kim
Power User
Posts: 802
Joined: 15 May 2014, 16:17

Re: Preset Help

Post by kim » 03 Nov 2018, 17:01

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
Last edited by kim on 04 Nov 2018, 02:56, edited 1 time in total.

blackmantis1
Posts: 6
Joined: 24 Oct 2018, 21:43

Re: Preset Help

Post by blackmantis1 » 03 Nov 2018, 20:19

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

kim
Power User
Posts: 802
Joined: 15 May 2014, 16:17

Re: Preset Help

Post by kim » 04 Nov 2018, 02:53

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

blackmantis1
Posts: 6
Joined: 24 Oct 2018, 21:43

Re: Preset Help

Post by blackmantis1 » 05 Nov 2018, 04:44

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?

User avatar
rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Preset Help

Post by rednoah » 05 Nov 2018, 16:20

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.
:idea: Please read the FAQ and How to Request Help.

Post Reply