Rename only files above a specific filesize

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
TehTempstack
Posts: 2
Joined: 04 May 2013, 10:12

Rename only files above a specific filesize

Post by TehTempstack » 04 May 2013, 10:23

Hi there,

I've set up a renaming job on my Synology NAS that is working perfectly fine - so let me first thank you a lot for this great tool.
There is only little thing that is that could be improved though:

From time to time the folders that are checked for files to be renamed do not only contain an episode but also a sample of the episode. So I was wondering if it is possible to perform the renaming and moving operation only on files above a specific file size - or the other way round, exclude files below a specific filesize from being treated.

Thanks in advance for your help!


P.S.: I've found this topic (http://www.filebot.net/forums/viewtopic.php?f=4&t=458) describing a similar scenario but I wasn't able to find a page where the option mentioned there was described (maybe together with a size option!?).

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

Re: Rename only files above a specific filesize

Post by rednoah » 04 May 2013, 11:25

Let's say we have a list of files called input, then you'd filter out small files like this:

Code: Select all

input = input.findAll{ it.length() > 250 * 10**6 } // keep only files bigger than 250 MB
This is the code for a filter you can bake into your groovy script. Or you can do the whole thing with bash and then call filebot only on the bigger files.

EDIT: Added a minfilesize option to amc.groovy
:idea: Please read the FAQ and How to Request Help.

TehTempstack
Posts: 2
Joined: 04 May 2013, 10:12

Re: Rename only files above a specific filesize

Post by TehTempstack » 05 May 2013, 10:05

Thanks a lot for your help, will give it a try! :)

Post Reply