[Custom Format] Binding for the parent parent folder name?

Any questions? Need some help?
Post Reply
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

[Custom Format] Binding for the parent parent folder name?

Post by mouzzampk2014 »

Hi, I have some folders which I need to rename to folder name

Code: Select all

\\192.168.0.43\data\.downloads\movies\Avatar (2008)\Avatar.2008.BluRay\Avatar.2008.BluRay.mkv
I am using this expression to rename and works fine with normal structure but I am having trouble when files are in multiple subfolders.

Code: Select all

\\192.168.0.43\data\.downloads\movies\{folder.name}
Is it possible to rename the file using parent folder.

Code: Select all

\\192.168.0.43\data\.downloads\movies\Avatar (2008).mkv
Thank you
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Subfolder Renaming

Post by rednoah »

You can do { f.dir.dir.name } if you wanna come at it from the right-hand side:

Code: Select all

{ f.dir.dir.name }
Alternatively, you can also copy folder levels from the left-hand side:

Code: Select all

{ f[0..5] }
:idea: Please read the FAQ and How to Request Help.
Post Reply