Page 1 of 1

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

Posted: 20 Oct 2021, 16:46
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