Page 1 of 1

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

Posted: 19 Feb 2022, 12:30
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

Re: Subfolder Renaming

Posted: 19 Feb 2022, 12:52
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] }