Page 1 of 1

Need help with renaming files - add info to file name

PostPosted: Fri Feb 10, 2017 3:27 pm
by fjon
I am trying to figure out how I can rename a big batch of files in a certain format, and I've only managed to get about half the information needed.

The files I have are in format:

12345678.txt

and the desired format is:

ABC.12345678.20170210.TE6578.01.10.txt

ABC will always be the same so I was able to add this
12345678 is the existing file name
20170210 is today's date in YYYYMMDD format. I was able to add this
TE6578 will be the same for each batch of files I want to rename.
01.10 = file 01 of 10. Second file should be 02.10 and so on

I am having trouble adding the last two components, i.e TE6578 and 01.10.

I was wondering if someone could give me some guidance on how to accomplish this?
Thanks in advance.

Re: Need help with renaming files

PostPosted: Sat Feb 11, 2017 5:30 am
by Emerkamp
Hello:

TE6578
Add (7)
Suffix=.TE6578.

01.10
Numbering (10)
Mode=Suffix
Padding=2

You'll need to do this after you've added the date to the end since bru, "Adds things In the same order as the options panel."
So add a counter as a place holder when adding your date so their's no name conflicts, Then remove it when running the step above.

As far as adding the total amount of files. You can check for the total along the bottom window and run bru using Add (7) again. as Final step

Re: Need help with renaming files - add info to file name

PostPosted: Mon Feb 13, 2017 9:16 am
by fjon
Many thanks. So it looks like this needs to be done in a few steps, which is fine. I was hoping it could be done in one step, but that's no big deal.

Re: Need help with renaming files - add info to file name

PostPosted: Mon Feb 13, 2017 7:28 pm
by Emerkamp
fjon wrote:Many thanks. So it looks like this needs to be done in a few steps, which is fine. I was hoping it could be done in one step, but that's no big deal.

Yes, Afraid so.
My way involves 3 steps.
You might cut this down to 2 steps by just adding all your strings to the name. Then use RegEx to rearrange the strings to how you want them.

I just weigh out the time it takes to think of clever tricks or more use of steps and pick the quicker method.

Re: Need help with renaming files - add info to file name

PostPosted: Mon Feb 13, 2017 8:40 pm
by fjon
Yeah, no big deal having to run it 2 or 3 times, certainly preferable to manually changing dozens or hundreds of filenames!

Re: Need help with renaming files - add info to file name

PostPosted: Tue Feb 14, 2017 12:16 am
by Admin
You can save each step in a file .BRU with "save as" (step 1 , step 2 etc) and then open them when you need it.
Alternatively you can do everything with a Javascript script, see special (14), but that requires a bit of coding, thanks