[Plain File Mode] Batch Rename any type of file

How-to guides, frequently asked questions, not-so-obvious features, etc
User avatar
The Source
Posts: 18823
Joined: 16 Nov 2011, 08:59
Location: Taipei

[Plain File Mode] Batch Rename any type of file

Post by rednoah »

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 press F2 (for Plain File Mode) or F3 (for Local Xattr Mode)
4. New Names will instantly filled with File objects (in Plain File Mode) or Movie / Episode objects (in Local Xattr Mode)
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.

:idea: Hit F3 after selecting an item to select a different metadata object.

:idea: --db file and --db xattr can be used for Plain File Mode and Local Xattr Mode on the command-line.

Batch Rename Photos

When organizing photos, I use the place where I took them and a serial number as the beginning of the filename (for sorting), followed by which camera took it and the photo number from the original filename.

Code: Select all

Taiwan {i.pad(3)} - iPhone {fn.after('IMG_') as int}
i ... item number, fn ... current filename

Pre-Process badly named episode files

FileBot cannot process badly named files like B&B Aug 4 - 14 so you will need to fix it first. Something like The Bold and The Beautiful - 2014.08.04 will immediately be much more sensible.

Code: Select all

{Date.parse('MMM dd - yy', fn.after(/\s/)).format('yyyy.MM.dd')}
Extract, parse and re-format the date.

Batch Rename files based on text content

Generating new filenames based on the text content of the files can be very useful when normalizing a set of text files.

Code: Select all

Report {i.pad(2)} {file.text.match(/\(.+\)/)}
Match first (...) pattern from the text content and add it to the filename.

Batch Rename files based on sibling XML files

In your format you have access to other files or web resources so you can easily build powerful rename logic for your own unique use cases. :ugeek:

Assuming a file structure like so:

Code: Select all

The contents of the .xml file looking something like this:

Code: Select all

	<Title>Ask Not</Title>
	<Series>The American Way</Series>
And a Groovy format:

Code: Select all

{xml = new XmlSlurper().parse(folder/fn+'.xml'); [xml.Series, xml.Number, xml.Series, xml.Title].join(' - ')}
You'll get output paths like this:

Code: Select all

The American Way - 1 - The American Way - Ask Not

Batch Rename files based on embedded media title tags

If you have suffered from data loss, and your data recovery software was only able to restore file contents, but not file names or folder structures, then you may be able to use metadata embedded in the file content to restore the original filenames.

Code: Select all


Code: Select all

$ filebot -rename /path/to/files --db file --file-filter mediaTitle --format {mediaTitle}
Rename files using [Plain File]
[MOVE] from [Babylon.5.S04E22.mkv] to [bab4d6-VTS_01_0-PGC3.mkv]
:idea: Please read the FAQ and How to Request Help.