zappagoblin wrote:Hi, I'm a newbie too but I have the same problem. I have a directory with 3000 files numbered like this:
1.xx
2.xx
...
10.xx
11.xx
...
I would change the name of this files like this:
0001.xx
0002.xx
...
0999.xx
1000.xx and so on.
If I use the PAD system in numbering I get this:
0001.xx
...
00011.xx
...
000111.xx
...
0001000.xx
but in this mode I can't sort alphabetically my files (0001.xx, 00010.xx, 00011.xx insthead of 0001.xx, 0002.xx)
I hope my english is not so horrible to explain my problem, sorry...
Thanks a lot.
Hi zappa, welcome.
Since you didn't provide real examples of how your file name looks, i can't provide you an valid solution.
FROM:
1.xx
2.xx
...
10.xx
11.xx
...
999.xx
1000.xx
TO:
0001.xx
0002.xx
...
0010.xx
0011.xx
...
0999.xx
1000.xx
Note:
Test this with test files first!
Select one or more files in the Name column to watch how the New Name will be.
Step 1)
Copy some of your files to an temp folder.
Open BRU and go inside this temp folder.
Use menu "Options > Sorting > Logical Sorting"
Make sure that your files are in an perfect order !!!
Don't do anything which could upset your order.
Step 2)
Remove old numbering.
Justing from your examples it seams we want to remove all leading digits till an . (dot) is reached.
So use:
RegEx(1)
Match: \d+\.(.+)
Repla: \1
Explanation:
\d+ => search one-or-more digits
\. => followed by an . dot
(.+) => then take the rest of the file name and "group" them with parentheses (...) to use that was is found here later as replacement by using \1
SO we get
FROM:
1.xx
99.xx
1000.xx
TO
xx
xx
xx
(I hope this xx is not your file extension? and there are some chars left to make the file name unique)
Step 3.)
Add an new numbering.
Numbering(10)
Mode [Prefix]
Pad [ 4] (or more if needed)
Sep.[ .] (an dot)
So we get
FROM:
xx
xx
xx
To:
0001.xx
0999.xx
1000.xx
As i have said, without real file names it's hard to guess what solution would fit to your issue.
But the basic rules here are:
1. order your files
2. remove old numbering
3. add new numbers
HTH?
