Page 1 of 1

Using foldername to rename file

Posted: 05 May 2021, 08:59
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!

Re: Using foldername to rename file

Posted: 05 May 2021, 09:18
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]
โ‹ฎ

Re: Using foldername to rename file

Posted: 07 May 2021, 08:41
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?

Re: Using foldername to rename file

Posted: 07 May 2021, 09:55
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.

Re: Using foldername to rename file

Posted: 09 May 2021, 14:20
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 ๐Ÿ˜