help rename folder to file

All about user-defined episode / movie / file name format expressions
Post Reply
User avatar
rednoah
The Source
Posts: 24206
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: help rename folder to file

Post 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
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: help rename folder to file

Post 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 ;)
User avatar
rednoah
The Source
Posts: 24206
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: help rename folder to file

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply