Need to rename file with folder name in middle

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Need to rename file with folder name in middle

Postby Jenn » Tue Mar 20, 2018 11:58 am

I have about 2400 files to rename with folders containing about 5 files a piece. Each file needs a different adjustment. The file names in each folder are the same but need to be numbered according to their original name (Prefix), Suffix text is based on original file name (Find/Replace got it), but the problem I have is how do I get the folder name in the middle of the file name? This would absolutely save me a ridiculous amount of time. Please any suggestions would be greatly greatly appreciated.

Here's an example:
Folder 12345
Original Files: Bob.pdf, Green.pdf, I dont get paid enough.pdf, need help.pdf
I need them to be: 2_12345_Guy.pdf, 1_12345_Color.pdf, 7_12345_mylife.pdf, 9_12345_Motto.pdf
Folder 6789
Original Files: Bob.pdf, Green.pdf, I dont get paid enough.pdf, need help.pdf, Tuesday.pdf
I need them to be: 2_6789_Guy.pdf, 1_6789_Color.pdf, 7_679_mylife.pdf, 9_6789_Motto.pdf, 4_6789_Today.pdf
Jenn
 
Posts: 2
Joined: Tue Mar 20, 2018 11:44 am

Re: Need to rename file with folder name in middle

Postby Emerkamp » Wed Mar 21, 2018 7:29 am

Hi,
Not understanding how your getting your Prefix, but

Two ways you can do this, Both are two steps
1. Add folder as prefix or suffix, while adding a "Filler" at the back or front. Make sure it's something easy you can remove in the second step.
2. Add final prefix while removing the "Filler" suffix from step 1

1. Add filenames in whatever order bulkrename will allow, Using a good Seperator. EX: Name - Name_-_Name
2. Use Regex to Reorder the name as per Seperator, While changing Sep back to what you want. EX: _'s.
You can do this with 1 Regex code
Emerkamp
 
Posts: 140
Joined: Sat Aug 23, 2014 2:35 pm

Re: Need to rename file with folder name in middle

Postby Jenn » Wed Mar 21, 2018 10:38 am

Thank you for the response, I'm going to give it a try.

The prefix is based on the file name. So all files named Bob would have a prefix of 2, all files named Green would have the prefix of 1, etc. Each folder has a different name, but all the files within the folders are named the exact same thing. The only variation is the folder name and some folders may have additional files.
Jenn
 
Posts: 2
Joined: Tue Mar 20, 2018 11:44 am

Re: Need to rename file with folder name in middle

Postby Emerkamp » Wed Mar 21, 2018 11:13 am

The only variation is the folder name and some folders may have additional files.


If you can do this, put the folder name somewhere and have good Seperators where inserted, and where it needs to go,
We can come up with a Regex code for you so you can reorder it. Regex works with String/Name pattern's, so think of this while working on it.
All names need a common pattern like Ex: name - name_name.ext
--We can reorder this easy--
Give us a few before and after examples, then we can help with the Regex.
Emerkamp
 
Posts: 140
Joined: Sat Aug 23, 2014 2:35 pm


Return to BRU Support