renaming files 7 subfolders deep

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

renaming files 7 subfolders deep Mon Apr 08, 2024 2:06 pm • by robodean
So i have hundreds of files nested deep inside of subfolders I need renamed based on one of its parents folder.

SSS/
render/
ACT01/
ACT01_SQ0010/
ACT01_SQ0010_SH0010/
render/
CHAR01_lighting_compositing_primary_4f410e60-a941-4083-a00c-c49ce9cb5b2c/
v7/
sss/
sss.1001.exr
sss.1002.exr
...

I need to rename each file "sss.1001.exr" to "ACT01_SQ0010_SH0010-SSS.1001.exr"

FROM THIS
https://share.cleanshot.com/k7NT4WNH
TO THIS
https://share.cleanshot.com/bj37cWk8

Each ACT has a series of SEQUENCES and each SEQ has a series of shots
So this rule would have to recursively go down to the bottom-most subfolder in each of shots, and rename the files with the name of the shot as a prefix.

i hope this makes sense.

any help would be much appreciated.
robodean
 
Posts: 18
Joined: Tue Aug 14, 2007 12:20 pm

Re: renaming files 7 subfolders deep Tue Apr 09, 2024 10:34 am • by Mr_Noodle
Are the files always the same number of folders below the ACT folder? It might be doable but it would be quite tricky. You could try setting up a rule using nested conditions and targeting the enclosing folder to grab the name and set it as a comment, then lower folders would do the same thing but use the comment instead of the folder name to pass it down.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: renaming files 7 subfolders deep Tue Apr 09, 2024 12:53 pm • by robodean
always the same number of folders deep!
robodean
 
Posts: 18
Joined: Tue Aug 14, 2007 12:20 pm

Re: renaming files 7 subfolders deep Wed Apr 10, 2024 9:29 am • by Mr_Noodle
Look up nested conditions in the manual as well as subfolder processing. I think the best route is to do as I mentioned earlier and apply a parent's name to a subfolder's comment and from there, propogate that comment down. You'll need to use subfolder level to determine which rules to apply at which level. I highly recommend doing this on a copy of your files and not on the real thing as once you do any subfolder stuff, the potential to scatter things around is high.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: renaming files 7 subfolders deep Wed Apr 10, 2024 2:01 pm • by robodean
this sounds beyond my abilities, i think.
I appreciate your help though. truly.
robodean
 
Posts: 18
Joined: Tue Aug 14, 2007 12:20 pm


Return to Support