Page 1 of 1

help rename folder to file

Posted: 13 Aug 2017, 18:30
by Crash82
hello I'm new here

I have been using filebot for a while but only for the basic use.

I have been searching to see if I can find a solution for a while now and I have not been able to find anything for what I'm trying to do
I'm trying to help out a friend to rename all his movies at the same time instead of doing one by one, but he want to do it in a specific way.
he wants the folder named to be copied to the filename and the folder name named to the movie name with year.

example
Folder: Kajaki.2014.Custom.DKsubs.720p.BluRay.x264-SUBLiME ----> Kajaki (2014)
Filname: sublime-kajaki720p.mkv ----> Kajaki.2014.Custom.DKsubs.720p.BluRay.x264-SUBLiME.mkv

I don't know if it's possible to do but I hope someone have an idea for it on how to do it

Thanks for the help

Re: help rename folder to file

Posted: 14 Aug 2017, 02:51
by rednoah
Yes, that sounds very simple. You can write a custom format for that.

Sounds like you won't even need to match with online databases because you just want the folder name twice. See "Generic Batch Renaming" for details on that.

@see viewtopic.php?f=3&t=2072

Re: help rename folder to file

Posted: 14 Aug 2017, 22:55
by Crash82
rednoah wrote: 14 Aug 2017, 02:51 Yes, that sounds very simple. You can write a custom format for that.

Sounds like you won't even need to match with online databases because you just want the folder name twice. See "Generic Batch Renaming" for details on that.

@see viewtopic.php?f=3&t=2072
Is it possible for you to give me an example, I look through the side you link and I can't understand how to make it work
basically I don't know what to do I don't understand it :(

Re: help rename folder to file

Posted: 14 Aug 2017, 23:36
by kim
You are looking for a format something like this:

Code: Select all

{file.parentFile.name.replaceFirst(/^(.+(?=.\d{4})).(\d{4}).+/, /$1 ($2)/)/file.parentFile.name}
FYI: this only works if ALL files are named like your e.g.
else you can make your own regex here:
http://regexr.com

Code: Select all

1. Drop files into Original Files
2. Click on the empty New Names component
3. Now that New Names has focus hit F2
4. New Names will instantly filled with File objects (or Episode / Movie objects if xattr metadata has previously been stored)
5. Double Click any item in New Names to apply a new Format Expression
then use my format
press rename = DONE ;)

Re: help rename folder to file

Posted: 15 Aug 2017, 02:01
by rednoah
Yep, follow the instructions and then use this format:

Code: Select all

/path/to/{folder.name}/{folder.name}
Replace /path/to with something that makes sense on your machine. The folder name will be the folder name, and the filename will also be the folder name.