Using foldername to rename file

Support for macOS users
Post Reply
John1928
Posts: 3
Joined: 05 May 2021, 08:52

Using foldername to rename file

Post by John1928 »

Hi,

I just downloaded the filebot app to use from my MacBook to rename files on my NAS. I try to keep it simple at first, but can’t seem to find a way to rename my files the way I want to. Each file is in a separate folder. The foldername is the exact name I want to use for that file. I’d like to use all information from the foldername in the filename, so no cleaning up. I can only seem to get filebot to create cleaned up names for the movie and episode files.

What settings should I use to accomplish this?

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

Re: Using foldername to rename file

Post by rednoah »

You can use Plain File Mode if you just want to rename files to the name of the folder:
viewtopic.php?t=2072


This custom format will generate the New Name based on the folder name for the file at hand:

Code: Select all

{folder.name}

e.g.

Code: Select all

$ filebot -rename -r /input --file-filter f.video --db file --format "{folder.name}" --action TEST --log INFO
[TEST] from [Avatar/a.mp4] to [Avatar/Avatar.mp4]
⋮
:idea: Please read the FAQ and How to Request Help.
John1928
Posts: 3
Joined: 05 May 2021, 08:52

Re: Using foldername to rename file

Post by John1928 »

Thanks, that worked 👍🏻
Is there also a way to automatically move the files one folder up?
Now, after the action you described above I have them like this: Tv show name (year)/season 01/tv show name.episode.properties/tv show name.episode.properties.mkv I’d like to automatically move al files of a season one folder up (and delete all empty folders). Is there an easy way for Filebot to do this?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using foldername to rename file

Post by rednoah »

John1928 wrote: 07 May 2021, 08:41 Is there also a way to automatically move the files one folder up?
Yes. Your custom format decides the destination path:

Code: Select all

../{folder.name}
or

Code: Select all

{folder.dir}/{folder.name}

:idea: The GUI does auto-delete left-behind empty folders, but since your moving files within the same file structure, this may or may not work for you. If not, then you can always use the cleaner script yourself.
:idea: Please read the FAQ and How to Request Help.
John1928
Posts: 3
Joined: 05 May 2021, 08:52

Re: Using foldername to rename file

Post by John1928 »

rednoah wrote: 07 May 2021, 09:55
John1928 wrote: 07 May 2021, 08:41 Is there also a way to automatically move the files one folder up?
Yes. Your custom format decides the destination path:

Code: Select all

../{folder.name}
or

Code: Select all

{folder.dir}/{folder.name}

:idea: The GUI does auto-delete left-behind empty folders, but since your moving files within the same file structure, this may or may not work for you. If not, then you can always use the cleaner script yourself.
Thanks, this worked perfectly! Had a little scare when it said deleting folders, but they were empty indeed 😁
Post Reply