rename on condition then autonumbering

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

rename on condition then autonumbering

Postby jmd » Thu Aug 19, 2010 3:32 pm

Hi,
I have used the program a few times, I have about 1500 files.
They are named like this:
1
1_001
1_002
1_003
1_004
2
2_001
2_002
2_003
3
3_001
3_002
3_003

I want to rename them, with numbering so that:
1_001 will be 4
2_001 will be 5
3_001 will be 6
1_002 will be 7
2_002 will be 8

Is this possible?
I racking my brains trying to figure it out.
jmd
 
Posts: 2
Joined: Thu Aug 19, 2010 3:26 pm

Re: rename on condition then autonumbering

Postby Stefan » Thu Aug 19, 2010 8:39 pm

jmd wrote:Hi,
I have used the program a few times, I have about 1500 files.
They are named like this:
1
1_001
1_002
1_003
1_004
2
2_001
2_002
2_003
3
3_001
3_002
3_003

I want to rename them, with numbering so that:
1_001 will be 4
2_001 will be 5
3_001 will be 6
1_002 will be 7
2_002 will be 8

Is this possible?
I racking my brains trying to figure it out.


FROM:
1
1_001
1_002
1_003
1_004
2
2_001
2_002
2_003
3
3_001
3_002
3_003

TO:
1
1_001 > 4
1_002 > 7
1_003 > 10?
1_004 > 13?
2
2_001 > 5
2_002 > 8
2_003 > 11?
3
3_001 > 6
3_002 > 9?
3_003 > 12?

I don't know. There seams no common pattern? At least i see non.
The "1_xxx"-range has four items, the "2_xxx" and "3_xxx" only three. ?!??
The only rule i see is:
1.) what is the highest single digit number? It is "3" in your example.
2.) rename all "X_001" in sequence starting by "4" (highest number from step 1.) +1)
3.) rename all "X_002" in sequence starting by "n" (highest number from step 2.) +1)
4.) rename all "X_003" in sequence starting by "n" (highest number from step 3.) +1)
5.) ...

I can see no way doing this with BRU, we would need scripting.
And without a few real examples of real file names from lower to highest number our help may fail anyway.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: rename on condition then autonumbering

Postby jmd » Fri Aug 20, 2010 4:13 am

TO:
1
1_001 > 4
1_002 > 7
1_003 > 10?
1_004 > 13?
2
2_001 > 5
2_002 > 8
2_003 > 11?
3
3_001 > 6
3_002 > 9?
3_003 > 12?


That is correct

And without a few real examples of real file names from lower to highest number our help may fail anyway.

The thing is there is about 40,000 files, in different folders so theres about 30 different renamings to do, there is no fixed amount, from a few hundred like this, to about 6,000 in some folders.
The prefix numbers however, go up to about 15 before they repeat again at 1, the above is a shortened example.

Really, I want to get anything that is **_001 and rename it in a numbered order starting at 16, if theres 15, that would end at 30.
The next one would be **_002 starting at 31, ending at 45.

1_001 to 16
1_002 to 17
1_003 to 18
1_004 to 19
1_005 to 20
1_006 to 21
1_007 to 22
1_008 to 23
1_009 to 24
1_010 to 25
1_011 to 26
1_012 to 27
1_013 to 28
1_014 to 29
1_015 to 30
2_001 to 31
2_002 to 32
2_003 to 33

This is not how you'd see it arranged by name in BRU, but as arranged by result
jmd
 
Posts: 2
Joined: Thu Aug 19, 2010 3:26 pm

Re: rename on condition then autonumbering

Postby Stefan » Fri Aug 20, 2010 2:52 pm

:D still not clear.

Still no real examples like:
I have 30 folders in one main top folder.
Folder 1 with 500 files from 1_001 till 8_123
Folder 2 with 5000 files from 9_001 till 48_123
...
...


-----------------------------------

First you have meant you need an sequence like:
1_001 > 4
2_001 > 5
3_001 > 6
1_002 > 7
That's something like: First numbering all *_001 occurrences. Then all *_002.

Now you want to number all 1_*** occurrences from 16 to 30 like:
1_001 to 16
1_002 to 17
1_003 to 18
1_004 to 19
1_005 to 20
1_006 to 21
1_007 to 22
...
2_001 to 31
2_002 to 32
2_003 to 33


---?

-----------------------------------


If the last it was you want then it looks easy.
1.) load all files into BRU incl. sub-folders
1
2
3
4
5
1_001
1_002
1_003
1_004
1_005
1_006
1_007
...
2_001
2_002
2_003

2.) select all X_xyz files only (not the single digits files)
3.) File(2) Remove
4.) Numbering(10), Start:16

Look at the NewName column how it works. If it is OK, click on Rename.
But do this with copies of all your files only!!! I don't know how this works for 40.000 files.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: rename on condition then autonumbering

Postby dele » Sat Aug 21, 2010 9:52 am

Maybe it could also work in two steps:

1. Step
Action: mark all lines in main-folder
regex (1) --> Match: ^(\d)_(\d\d\d)(.*) / Replace: \2_\1\3 / Include ext.: no
Selections(12) --> Filter: * / Subfolders=on
Action: rename

2. Step
Action: mark all lines in main-folder
Selections(12) --> Filter: *_* / Subfolders=on
Remove(5): --> Chars: _ / Digits=on
Numbering(10): --> Mode: Prefix / Start: Highest number + 1 / Incr=1
Action: rename

Works for me with one folder and one subfolder and some testfiles
dele
 
Posts: 16
Joined: Sun May 22, 2005 12:00 pm

Re: rename on condition then autonumbering

Postby dele » Sat Aug 21, 2010 9:55 am

Please forget my last post.
The solution of Stefan is much better.
dele
 
Posts: 16
Joined: Sun May 22, 2005 12:00 pm

Re: rename on condition then autonumbering

Postby dele » Sat Aug 21, 2010 11:53 am

I thought about it again.
I think my solution will do what was originally requested.
dele
 
Posts: 16
Joined: Sun May 22, 2005 12:00 pm


Return to BRU Support


cron