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

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

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

Post by rednoah »

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

Code: 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:

Code: Select all

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

Code: 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