[Plain File Mode] Strip brackets [...] from the file path

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[Plain File Mode] Strip brackets [...] from the file path

Post by rednoah »

GUI:
Use Plain File Mode with custom plain file format:

Format: Select all

{ folder.path.removeAll(/\[.+?\]/) }/{ fn.removeAll(/\[.+?\]/) }
fn ... file name without extension
folder.path ... parent folder file path
/\[.+?\]/ ... regular expression that matches [...] patterns



CLI:
Use --db file to rewrite file paths:

Shell: Select all

filebot -rename -r /input --db file --file-filter "f.path =~ /\[.+?\]/" --format "{ folder.path.removeAll(/\[.+?\]/) }/{ fn.removeAll(/\[.+?\]/) }" --action TEST

Console Output: Select all

[TEST] from [/input/Alias [720p]/Alias 1x01 [720p].mkv] to [/input/Alias/Alias 1x01.mkv]

--file-filter "f.path =~ /\[.+?\]/" ... select only files that contain [...] patterns in the file path
:idea: Please read the FAQ and How to Request Help.
Post Reply