Mission: Impossible?

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

Mission: Impossible?

Postby by_him » Mon Jun 21, 2010 6:10 pm

I really have a problem here... I need to change this sequence:
****************
name1
name2
name3
name4
.
.
.
name4200 (for instance)
*****************


Into this one:

*****************
TEST0001name1 (original would be "name1")
TEST0001name2 (original would be "name2")
TEST0001name3 (original would be "name3")
.
.
.
TEST0001name300
TEST0002name1 (original would be "name301")
TEST0002name2 (original would be "name302")
TEST0002name3 (original would be "name303")
.
.
.
TEST0002name300
TEST0003name1 (original would be "name601")
TEST0003name2 (original would be "name602")
TEST0003name3 (original would be "name603")
.
.
.
TEST0014name300 (original would be "name4200")

******************

As you noticed, "x" is a consecutive number that changes in "TEST000xname" after every 300 original files, which must keep on repeating in sequence at the end of file name (1-300).

Any idea? Yeah, I know it is difficult...

Thanks so much!
Sam
(Madrid) - Spain
by_him
 
Posts: 5
Joined: Mon Jun 21, 2010 5:56 pm

Re: Mission: Impossible?

Postby Stefan » Tue Jun 22, 2010 9:59 pm

FROM:
name1 till name300
TO:
TEST0001name1 till TEST0001name300

AND:
name301 till name600
TO:
TEST0002name1 till TEST0002name300

AND:
name601 till name900
TO:
TEST0003name1 till TEST0003name300
and so on...

Not easy with BRU, i found no way.

You could use
Selection(12) and [*42?] to select all files with 42x in name, and 42?? for all files with 42xy
and
RegEx(1) with "name42\d\d" to "TEST0014name"
and
Numbering(10) with "Suffix" 1,4,0
BUT
Especially the last sequences with name3901 till name4200 would be hard to do
because you would have to do this last sequence with two steps like
first: Selection(12) with [*39??]
and then: Selection(12) with [*42??]
and that all in all makes it to complicated.

Yes, if we could use an RegEx expression to select files...
like Selection(12) [ (name39\d\d | name42\d\d) ], then perhaps we would have an change to do this with BRU in 14 steps.



---

Till then you may wanna try ReNamer from Den4b? See here for an script for your issue >>> http://www.den4b.com/forum/viewtopic.php?pid=4734#p4734

Hope that helps? That script takes the time of an whole soccer game :D

(O)
||+-----------+
||| #000000 |
||+-----------+
||| #FF0000 |
||+-----------+
||| #FFFF00 |
||+-----------+
||
||
||
||
||
||
||
||
~~


---
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Mission: Impossible?

Postby by_him » Tue Jun 22, 2010 10:18 pm

My dear Stefan,

I am so thankful for your time. May my God reward you!

I was going to try an automation software (WinAutomation), but it seems you "saved" my life. I am going to try your ReNamer approach.

Thanks again, buddy!
Sam
Last edited by by_him on Tue Jun 22, 2010 11:18 pm, edited 2 times in total.
by_him
 
Posts: 5
Joined: Mon Jun 21, 2010 5:56 pm

Re: Mission: Impossible?

Postby by_him » Tue Jun 22, 2010 10:34 pm

I have two other questions:

1) Your batch for testing:

@ECHO OFF
REM set /p "amount=How many files do you want to create?"
set amount=4200
for /l %%i in (1,1,%amount%) do (copy nul name%%i >NUL)

Sorry, but I am a noob here. How do I apply that? What program and in what place (of that program) should I paste that to work?

2) Let's say we have not 4200, but 4257, and I want to make groups of 300, 300, 300... and so on, and then make another group with the remainder (in this case, 57is the remainder), following the same rules. Of course, we may have different file number (7890, 34500, 57900, etc....)


Sam
by_him
 
Posts: 5
Joined: Mon Jun 21, 2010 5:56 pm

Re: Mission: Impossible?

Postby by_him » Tue Jun 22, 2010 11:48 pm

Hi again,

I am trying to apply on ReNamer your batch:

**********
var
str, digits: WideString;

begin

str := ReplaceRegEx(FileName, '(.+?)\d+', '$1', False, True);
digits := ReplaceRegEx(FileName, '.+?(\d+)', '$1', False, True);

If (StrToInt(digits) > 0) AND (StrToInt(digits) < 301) Then
FileName := 'TEST0001' + str + digits;

end.

*******

To "name1" and "name2" and it doesn't work (it just keeps same names). It should work even if we don't have 300 files (just 2), shouldn't it? I am trying the code as "PascalScript"

Sam
by_him
 
Posts: 5
Joined: Mon Jun 21, 2010 5:56 pm

Re: Mission: Impossible?

Postby Stefan » Wed Jun 23, 2010 7:09 am

Hi Sam,

by_him wrote:I have two other questions:

1) Your batch for testing:

@ECHO OFF
REM set /p "amount=How many files do you want to create?"
set amount=4200
for /l %%i in (1,1,%amount%) do (copy nul name%%i >NUL)

Sorry, but I am a noob here. How do I apply that? What program and in what place (of that program) should I paste that to work?

This is an DOS batch file. Here is how to use this:
- got to C:\Temp
- create an new folder named "4200"
- go to C:\Temp\4200
- create an new text file from WindowsExplorer context menu > New > New Text file
- leave the suggested name "New textfile.txt"
- open this file by double clicking into notepad
- copy the batch code from above into it
- save the file
- rename it to "something.CMD"
- double click on it
- wait a few seconds....
- done
(maybe, if you doesn't use Windows XP, the last step may not work... i don't can try this right now)


2) Let's say we have not 4200, but 4257, and I want to make groups of 300, 300, 300... and so on, and then make another group with the remainder (in this case, 57is the remainder), following the same rules. Of course, we may have different file number (7890, 34500, 57900, etc....)

Sam

I am only an poor scriptwriter, not an full fledged programmer/coder :D
SO i didn't wrote an elegant algorithm to handle all possibilities you may came up too in the future :lol: , i just, lets say, make an kind of brute force coding.
That means, if you come now with more requests, one have to recruit this script to add even more samples.
Note: Perhaps its better to provide us all possible pattern of your files (and some real file names!) to help you better (if even we could...don't know if we are able)
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Mission: Impossible?

Postby Stefan » Wed Jun 23, 2010 7:24 am

by_him wrote:Hi again,

I am trying to apply on ReNamer your batch:

**********
var
str, digits: WideString;

begin

str := ReplaceRegEx(FileName, '(.+?)\d+', '$1', False, True);
digits := ReplaceRegEx(FileName, '.+?(\d+)', '$1', False, True);

If (StrToInt(digits) > 0) AND (StrToInt(digits) < 301) Then
FileName := 'TEST0001' + str + digits;

end.

*******

To "name1" and "name2" and it doesn't work (it just keeps same names).
I am trying the code as "PascalScript"
Sam

I just tried it on an other computer and it works for me.
Some thoughts:

If you add an PascalScript rule and want to paste in my script
you have to remove the default
begin
// Add your code here
end.

before.

I don't know... maybe you have to use the lasted beta of that application?
Or you have to click on [Preview]?

But please note that this here is not the right forum to give support for that tool.
I just gave an hint to aid you to solve your challenge.
If you are interested go and join that other forum.

It should work even if we don't have 300 files (just 2), shouldn't it?

Yes this should be, that's why i didn't use one of the numbering rules, which would depend on the current loaded files, but add that numbering into the script.

I hope you work this out somehow.
CIAO :wink:
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Mission: Impossible?

Postby by_him » Wed Jun 23, 2010 4:14 pm

Hi there again,

Yep, I tested it today, and it seems to work nice.

However, I found a problem (see other forum).

Thankful indeed,
Sam
by_him
 
Posts: 5
Joined: Mon Jun 21, 2010 5:56 pm


Return to BRU Support